|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I have a plugin function which produces some output.
In template it's called in a following way: {my_function arg1="val1" arg2="val2"} Is there any way to insert a value of, for example $smarty.get.my_var for one of the arguments??? Lines below cause compiler error. {my_function arg1="$smarty.get.my_var" arg2="val2"} {my_function arg1="{$smarty.get.my_var}" arg2="val2"} PS: I know that using directly request vars in templates is not a good practice, but this is just an example Dmitriy |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Thu, Feb 23, 2006 at 11:55:53AM +0200, Dep wrote:
> I have a plugin function which produces some output. > In template it's called in a following way: > > {my_function arg1="val1" arg2="val2"} > > Is there any way to insert a value of, for example $smarty.get.my_var > for one of the arguments??? > Lines below cause compiler error. > > {my_function arg1="$smarty.get.my_var" arg2="val2"} > {my_function arg1="{$smarty.get.my_var}" arg2="val2"} {my_function arg1=$smarty.get.my_var arg2="val2"} should work fine for more examples see: http://smarty.php.net/manual/en/lang...tax.quotes.php > PS: I know that using directly request vars in templates is not a good > practice, but this is just an example > > Dmitriy > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
{my_function arg1="{$smarty.get.my_var}" arg2="val2"} - this is true variant of used GLOBAL variables in your template function.
-----Original Message----- From: Dep <dep@ztu.edu.ua> To: smarty-general@lists.php.net Date: Thu, 23 Feb 2006 11:55:53 +0200 Subject: [SMARTY] Special variables in function calls > I have a plugin function which produces some output. > In template it's called in a following way: > > {my_function arg1="val1" arg2="val2"} > > Is there any way to insert a value of, for example $smarty.get.my_var > for one of the arguments??? > Lines below cause compiler error. > > {my_function arg1="$smarty.get.my_var" arg2="val2"} > {my_function arg1="{$smarty.get.my_var}" arg2="val2"} > > PS: I know that using directly request vars in templates is not a good > practice, but this is just an example > > Dmitriy > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
Does Smarty support the mod math operator?
In PHP 4 % 3 returns 1. Urb |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
I'm building a table and after every third <td> I want to start a
new row. This works: {if $smarty.section.Photos.iteration % 3 == 0}</tr> <tr>{/if} Urb >. > >Urb > >-- >Smarty General Mailing List (http://smarty.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > |
|
![]() |
| Outils de la discussion | |
|
|