[ xxxrugby @ 09.02.2007. 13:58 ] @
Covjece kako mi se cini da cu sve napravit u cistom php-u jel je lakse nego s smarty-em

Ok.

Kako iz smarty-a pozvat ovakau PHP klasu

Code:
<?PHP
    class Section
    {
        function vrati_header()
        {
            return "NOVOSTI";
        }
        
        function vrati_file()
        {
            return "novosti.tpl";
        }
    }
?>


te sad unutar tpl-a.

{PHP}
include ("php_classes/switch_case");
$Section = new Section()
$path = $Section -> vrati_file(); // npr. novosti.tpl
////////// i sad bi tu neku komandu kao {include file = $path}
{/PHP}

ili da se bar taj $path vidi izvan {PHP} komandi
[ xxxrugby @ 09.02.2007. 14:27 ] @
rjeseno

{php}
$Section = new Section();
$p = $Section -> vrati_file();
$this->assign('path',$p);
{/php}
{include file=$path}