Mam zintegrowane smarty z zend_layout. Problem w tym ze w smarty nie mozna wywolac obiektow w ten sposob:
$this->headStyle()->appendStylesheet('/css/site.css')
Mam wiec plugina do smarty z EZ, ktory ma umozliwic wykonanie powyzszej operacji w sposob taki {headStyle method=appendStylesheet args=/css/site.css} Niestety nie dziala. Nie wywoluje bledow, ale tez nie wstawia linku do arkusza styli.
Ponizej kod plugina:
<?php function smarty_function_headStyle($params, &$smarty) { $toReturn = ""; try { if ($method != - 1) { //oppress errors $toReturn = $smarty->_tpl_vars ['this']->headStyle()->$method ( $args ['src'] ); } else { $toReturn = $smarty->_tpl_vars ['this']->headStyle()->$method ( $args ); } } else { $toReturn = $smarty->_tpl_vars ['this']->headStyle (); } return $toReturn; } catch ( Exception $e ) { return $toReturn; } } ?>
Problem rozwiazany. Zastapilem headStyle() z headLink().