logo       

RE: [SMARTY] file name: msg#00389

php.smarty.general

Subject: RE: [SMARTY] file name

You can work backwards when you're learning:

Separate the 'static' parts of 1.html from the
'variable' stuff in 1.html. Rename 1.html as id.tpl.
whatever you want to dynamically change in id.tpl,
assign it a variable name and surround it in braces:
for instance, do Welcome {$username} not Welcome Fred.
Then in your index.php, make a new instance of Smarty
as shown in the docs, and do a
$Smarty->assign('username', $userFnameFromDB);
$Smarty->display('id.tpl');
The idea is you assign to Smarty any of the variable
content you want in your page, then choose a template
to display.
Hope this gets you started.

> -----Original Message-----
> From: Neeraj Rattu [mailto:neeraj@xxxxxxxxxxxxxxxxxxxxxxx]
> Sent: Tuesday, January 28, 2003 7:08 AM
> To: smarty-general@xxxxxxxxxxxxx
> Subject: [SMARTY] file name
>
>
> Hi List,
>
> I have just downloaded smarty and started working with it.
>
> Can any one please help me
>
> How do i publish somename.html file using smarty template.
> And I want to dynamically name pages depending upon the ID of
> a person from the database
>
> For eg ApplicantID is 1 I want to name a file as 1.html
>
> How do I do this?
>
> Please help I am new to smarty ..
>
> Thanks in advance
>
> Warm Regards,
> Neeraj
>


--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise