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

Smarty masiv est problemka

 
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
berlion
Smarty n00b


Joined: 12 Mar 2010
Posts: 1

PostPosted: Fri Mar 12, 2010 1:19 pm    Post subject: Smarty masiv est problemka Reply with quote

народ есть вопрос ...
тэмплэйты на Smarty
в тэмплэйте объявил переменные масива
{$img[0]}
{$img[1]}
{$img[2]}
===
в пхп хочу отдельно занетси к примеру в элимент с индэксом 1
значение переменной $imgful... как это реализовтаь .. я уже методом потбра пыталса...в манулалах такой ситуации не описанно
$smarty->assign('img[1]',"$imgful"); это не пашит
Back to top
View user's profile Send private message
sergNN
Smarty Rookie


Joined: 10 Oct 2006
Posts: 12
Location: Bad Homburg

PostPosted: Thu May 20, 2010 2:56 pm    Post subject: Reply with quote

делай так

$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
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