You are here: Re: smarty simple question? « PHP Programming Language « IT news, forums, messages
Re: smarty simple question?

Posted by phpCodeHead on 06/07/07 15:06

On Jun 7, 5:52 am, Gene <ox.g...@wp.pl> wrote:
> i'm newcomer in using smarty and i have problem like this:
> i want to have one template file (e.g. index.tpl) in this file section
> which use variable {$content}.
> and two files *.php which are using the same template index.tpl and
> only change the content.
>
> for example:
> /*index.php*/
> $smarty = new MySmarty();
> $smarty->assign('content','INDEX');
> /*about.php*/
> $smarty=new MySmarty();
> $smarty->assign('content','ABOUT');
>
> how to do this, because this way it doesn't work?

give your second inherited MySmarty() object a different reference
name:
....
/*about.php*/
$smarty2 = new MySmarty();
$smarty2->assign('content','ABOUT');

hth,

gk

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация