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

Pass param to funck

 
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 -> Language: Russian
View previous topic :: View next topic  
Author Message
mizha
Smarty n00b


Joined: 20 Mar 2014
Posts: 1

PostPosted: Thu Mar 20, 2014 11:13 pm    Post subject: Pass param to funck Reply with quote

Привет всем! Пишу на Smarty не так давно, возникла трудность, как передать параметр в функцию.

Обычно, если функция ничего не принимает, то я делаю так
Code:

$smarty->assign('test', mytest());


И использую там, где надо. А когда столкнулся, что надо такое, то не знаю, как сделать.
Code:

$smarty->assign('test', mytest($param));


Был вариант написать плагин, но это не удобно. Хотелось бы использовать более простой вариант
Back to top
View user's profile Send private message
ZeRoLeVeL
Smarty Rookie


Joined: 13 May 2014
Posts: 6

PostPosted: Tue Jun 03, 2014 12:49 pm    Post subject: Reply with quote

И в чем проблема?
Code:
// Блок 5 случайных вакансий
$tpl->assign( '5rand_Vac', rand_row("vacancy") );
// Блок 5 случайных резюме
$tpl->assign( '5rand_Sum', rand_row("summary") );

Работает нормально.
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 -> Language: Russian 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