|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
fpoussie Smarty n00b
Joined: 22 Jun 2004 Posts: 2
|
Posted: Tue Jun 22, 2004 1:02 pm Post subject: smarty_block |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Tue Jun 22, 2004 8:52 pm Post subject: |
|
|
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 |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Tue Jun 22, 2004 9:21 pm Post subject: |
|
|
$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 |
|
fpoussie Smarty n00b
Joined: 22 Jun 2004 Posts: 2
|
Posted: Wed Jun 23, 2004 7:46 am Post subject: |
|
|
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 |
|
|
|
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
|