Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Displaying available variables in a template

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-09-2005, 03:30 PM
 
swaylock swaylock is offline
 

Newbie
  
Join Date: Dec 2004
Posts: 3
 

Default Displaying available variables in a template

Hi all,

Hope I'm not jumping th gun with this question, but I have searched and couldn't find anything.

I'm coming from a PERL background and in PERL there is a function/module called "dumper" that when used in a template context will print out all the key value variable pairs available in that template.

This really helps during development.

Is there anything like that with the SMARTY template engine?

Any help would be great. Many thanks, Mike
__________________
Mike Paler
X-Cart Pro 4.0
Swaylock\'s Surfboard Design Forum
http://www.swaylocks.com
Reply With Quote
  #2  
Old 06-09-2005, 03:39 PM
 
swaylock swaylock is offline
 

Newbie
  
Join Date: Dec 2004
Posts: 3
 

Default this may be the answer

From the smarty site faqs

Q: Is there an instruction to get all vars assigned to a template? (Mattia)

A: Yes, using get_template_vars (Oscar Fernandez Sierra):

// get all assigned template vars
$tpl_vars = $smarty->get_template_vars();
// take a look at them
var_dump($tpl_vars);
__________________
Mike Paler
X-Cart Pro 4.0
Swaylock\'s Surfboard Design Forum
http://www.swaylocks.com
Reply With Quote
  #3  
Old 06-10-2005, 05:50 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

http://forum.x-cart.com/viewtopic.php?t=17601
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #4  
Old 06-10-2005, 07:57 AM
 
swaylock swaylock is offline
 

Newbie
  
Join Date: Dec 2004
Posts: 3
 

Default Thanks!!

Many thanks!!!

__________________
Mike Paler
X-Cart Pro 4.0
Swaylock\'s Surfboard Design Forum
http://www.swaylocks.com
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:56 PM.

   

 
X-Cart forums © 2001-2020