|
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 |
berlion Smarty n00b
Joined: 12 Mar 2010 Posts: 1
|
Posted: Fri Mar 12, 2010 1:19 pm Post subject: Smarty masiv est problemka |
|
|
народ есть вопрос ...
тэмплэйты на Smarty
в тэмплэйте объявил переменные масива
{$img[0]}
{$img[1]}
{$img[2]}
===
в пхп хочу отдельно занетси к примеру в элимент с индэксом 1
значение переменной $imgful... как это реализовтаь .. я уже методом потбра пыталса...в манулалах такой ситуации не описанно
$smarty->assign('img[1]',"$imgful"); это не пашит |
|
Back to top |
|
sergNN Smarty Rookie
Joined: 10 Oct 2006 Posts: 12 Location: Bad Homburg
|
Posted: Thu May 20, 2010 2:56 pm Post subject: |
|
|
делай так
$my_arr = array();
$my_arr[] = $img_1;
$my_arr[] = $img_2;
$my_arr[] = $img_3;
потом передавай в темплэйт:
$smarty->assign('img', $my_arr);
ну и теперь работай в темплэйте
{$img[0]}
{$img[1]}
{$img[2]} |
|
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
|