View previous topic :: View next topic |
Author |
Message |
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Aug 23, 2010 12:48 pm Post subject: |
|
|
{extends} must always be the first line of a template file, so you can't decide if a template extends another template or not. Either it does or it doesn't. |
|
Back to top |
|
Vultapher Smarty n00b
Joined: 20 Aug 2010 Posts: 3
|
Posted: Mon Aug 23, 2010 3:22 pm Post subject: |
|
|
Vultapher wrote: | Huh yea, didn't think about that. Thanks | Correction: This does not work, it looks like one can't pass the output to the modifier, Smarty throws a syntax error.
We tried Code: | {html_select_date <parameters> |utf8_encode} | and some other variations, with the same results. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Mon Aug 23, 2010 4:31 pm Post subject: |
|
|
The modifier must be attached directly to the tag name.
Code: | {html_select_date|utf8_encode <parameters>} |
|
|
Back to top |
|
mayco Smarty n00b
Joined: 03 Sep 2010 Posts: 1
|
Posted: Fri Sep 03, 2010 2:25 pm Post subject: |
|
|
I'm having issues to load the variable that is specified in a {include tag
I have this code in a template
customer_view.tpl
Code: |
{include file="header.tpl" currentPage="customer_search.php"}
|
header.tpl
Code: |
This works: {$currentPage}
{php}
$tmp = $smarty->getTemplateVars('currentPage');
print_r($tmp); // This doesn't work
{/php}
|
$tmp seems to be a Undefined_Smarty_Variable Object ( )
I also tried the $smarty->getVariable();
I also noticed that i had to use $smarty instead of $this. When i use $this, i get the following message:
Fatal error: Using $this when not in object context in /home/x/smarty3svn/Smarty3Dev/distribution/libs/plugins/block.php.php(24) : eval()'d code on line 10 |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Sep 03, 2010 2:50 pm Post subject: |
|
|
you are trying to access a local var. I'm not sure how that works internally, Uwe may chime in.
Of course the real question, why use the deprecated {php} tag for anything. It should be avoided, and there is always a better way. |
|
Back to top |
|
ziege Smarty Rookie
Joined: 16 Aug 2005 Posts: 13
|
Posted: Sat Sep 04, 2010 12:32 pm Post subject: |
|
|
I think I have an issue too (or a missing point in the Smarty2 BC Notes):
I work with several includes, in one a variable named "tmp" is set.
But when I use
{counter start=0 assign=tmp}
later on in another include, the "tmp" variable is not overwritten.
I printed out the value of "tmp" before and after the {counter...} call, and it's the same old value (which was set in the other include) in both cases.
I fixed it by replacing {counter...} with {assign...} (in this case I can overwrite the variable "tmp"). |
|
Back to top |
|
ziege Smarty Rookie
Joined: 16 Aug 2005 Posts: 13
|
Posted: Sat Sep 04, 2010 2:14 pm Post subject: |
|
|
Another issue:
I got the following error
Quote: | Syntax Error in template "C:/Apache2/htdocs/xxx.tpl" on line 3 "{/strip}" - Unexpected "{/strip}", expected one of: "comment" , "PHP start tag" , "PHP end tag" , ASPSTARTTAG , ASPENDTAG , "Fake PHP start tag" , XMLTAG , "text" , "newline" , "Literal start" , "{" , LDELIF , LDELFOR , LDELFOREACH , "closing tag" |
for the following (uncommon but correct) template:
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Sep 07, 2010 4:53 pm Post subject: |
|
|
{counter} and {cycle} plugins did not use the correct scope when assigning results.
Templates containing just {strip} and {/strip} tags did produce an error.
The fixes are in the SVN now. |
|
Back to top |
|
vorapoap Smarty Rookie
Joined: 22 Dec 2009 Posts: 32
|
Posted: Thu Sep 09, 2010 7:14 am Post subject: gettext? |
|
|
Any plan to incorporate gettext into Smarty Core? |
|
Back to top |
|
|