- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
{php}
$this->_tpl_vars['image_set'] = array();
$this->_tpl_vars['json_string'] = "";
{/php}
{if $pcollection}
{foreach name=pcollection key=picture_id item=picture from=$pcollection}
{php}
array_push($this->_tpl_vars['image_set'], "{$this->_tpl_vars['urlprefix']}/thumb.php?file=" . str_replace("thumbs","original","media/pictures/{$this->_tpl_vars['album']->getPath()}/{$this->_tpl_vars['picture']->getPath()}")."&size=245x143");
{/php}
{/foreach}
{/if}
{php}
$this->_tpl_vars['json_string'] = json_encode($this->_tpl_vars['image_set']);
{/php}
{$json_string}
получение объекта в smarty, потом пара фокусов, и вуаля, выплевываем json строку
eth0 16.05.2014 18:54 # +4
guest 23.05.2014 15:21 # +1