|
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 |
mizha Smarty n00b
Joined: 20 Mar 2014 Posts: 1
|
Posted: Thu Mar 20, 2014 11:13 pm Post subject: Pass param to funck |
|
|
Привет всем! Пишу на Smarty не так давно, возникла трудность, как передать параметр в функцию.
Обычно, если функция ничего не принимает, то я делаю так
Code: |
$smarty->assign('test', mytest());
|
И использую там, где надо. А когда столкнулся, что надо такое, то не знаю, как сделать.
Code: |
$smarty->assign('test', mytest($param));
|
Был вариант написать плагин, но это не удобно. Хотелось бы использовать более простой вариант |
|
Back to top |
|
ZeRoLeVeL Smarty Rookie
Joined: 13 May 2014 Posts: 6
|
Posted: Tue Jun 03, 2014 12:49 pm Post subject: |
|
|
И в чем проблема?
Code: | // Блок 5 случайных вакансий
$tpl->assign( '5rand_Vac', rand_row("vacancy") );
// Блок 5 случайных резюме
$tpl->assign( '5rand_Sum', rand_row("summary") ); |
Работает нормально. |
|
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
|