Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Getting assigned variables from the php file

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Psyche
Smarty Regular


Joined: 16 Apr 2006
Posts: 35

PostPosted: Thu Apr 12, 2007 4:32 pm    Post subject: Getting assigned variables from the php file Reply with quote

Hello,

Is it possible to verify in the tpl file which variables have been assigned from the php file?
Back to top
View user's profile Send private message
TGKnIght
Smarty Junkie


Joined: 07 Sep 2005
Posts: 580
Location: Philadelphia, PA

PostPosted: Thu Apr 12, 2007 4:57 pm    Post subject: Reply with quote

Either set $smarty->debugging = 1

http://smarty.php.net/manual/en/variable.debugging.php

or put a {debug} in the template you want to debug

http://smarty.php.net/manual/en/language.function.debug.php
_________________
Smarty site with one index.php controller file
Working with MySQL and Smarty
SmartyColumnSort
Custom Smarty Javascript Debug Template
Back to top
View user's profile Send private message Visit poster's website
Psyche
Smarty Regular


Joined: 16 Apr 2006
Posts: 35

PostPosted: Thu Apr 12, 2007 5:08 pm    Post subject: Reply with quote

Hmm, it goes like this: based on some conditions I'm assigning values to the .tpl. And in the .tpl I would like to display only the values I have assigned. I don't want to assign al the values and then display them.
Back to top
View user's profile Send private message
TGKnIght
Smarty Junkie


Joined: 07 Sep 2005
Posts: 580
Location: Philadelphia, PA

PostPosted: Thu Apr 12, 2007 7:32 pm    Post subject: Reply with quote

Either make each of these values elements of an array, assign the whole array to smarty as one variable, then loop through that array.

Or you can always use {if isset($somevar)}{$somevar}{/if}
_________________
Smarty site with one index.php controller file
Working with MySQL and Smarty
SmartyColumnSort
Custom Smarty Javascript Debug Template
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP