Re: [SMARTY] PHPlib -> SMARTY
| From: | Manfred 'dwerg' Stienstra | Date: | Thu, 15 Aug 2002 10:05:34 +0000 |
| Subject: | Re: [SMARTY] PHPlib -> SMARTY | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5725@lists.php.net to get a copy of this message | ||
On Thursday 15 August 2002 11:58, John Wards wrote:
> I have the task of converting an App running PHPlib templates to SMARTY and
> I have a few questions.
>
> $t = new Template($cfg_temproot, "remove"); (PHPlib)
> would be this in SMARTY?
> $smarty = new Smarty;
>
> $t->set_var("rc", $rc);(PHPlib)
> would be this in SMARTY?
> $smarty->assign("rc", $rc);
Yes
> $t->set_file("start","start_free.htm");
> $t->set_block("start", "bull_block", "bulls");
> $t->set_block("bull_block", "new_iss_block", "newiss");
> $t->set_block("bull_block", "sent_iss_block", "sentiss");
> What woudl that be in SMARTY?
This does not convert to smarty one to one. Smarty acts very differently when
dealing with 'blocks' of code. You can assign an array to the template and
loop trough it in the template. This probably requires some recoding.
> Same for this?
> $t->parse("sentiss","sent_iss_block",true);
>
> And this?
> $t->parse("out", "start");
In the end you call ->fetch('start_free.tpl') or
->display('start_free.tpl')
The best thing you can do is read the manual and come back if you still don't
know how to convert.
dwerg