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

smarty_block

 
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 -> Bugs
View previous topic :: View next topic  
Author Message
fpoussie
Smarty n00b


Joined: 22 Jun 2004
Posts: 2

PostPosted: Tue Jun 22, 2004 1:02 pm    Post subject: smarty_block Reply with quote

I created a new block named "form".
I want to get the name of the template by using $smarty->_current_file.
This works fine in a user defined tag. But not in a block.

Is there an issue ?

thanks in advance
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Tue Jun 22, 2004 8:52 pm    Post subject: Reply with quote

hmm. From the template we use $smarty.template to get that info. I don't know if there is a corresponding API call. Certainly, you should avoid using the private implementations (which all begin with underscore) such as _current_file.
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Tue Jun 22, 2004 9:21 pm    Post subject: Reply with quote

$smarty->_current_file is only available in the compiler, but not in "normal" smarty operation.

you have to pass {block template=$smarty.template ...} to your block-function or use some postfilter or a compiler-function to emit php-code that saves $smarty->_current_file at compile-time to make it available at display-time.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
fpoussie
Smarty n00b


Joined: 22 Jun 2004
Posts: 2

PostPosted: Wed Jun 23, 2004 7:46 am    Post subject: Reply with quote

thanks a lot.
I tried the $smarty.template value which today returns the value "objecttemplate"

I keep in mind that i have to make a postfilter or something like that, to make the correct value available at display time.
Back to top
View user's profile Send private message
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 -> Bugs 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