|
RE: [SMARTY] file name: msg#00389php.smarty.general
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> |
|---|---|---|
| Previous by Date: | RE: [SMARTY] newbie question: 00389, Hoffman, Geoffrey |
|---|---|
| Next by Date: | [SMARTY] How to pass a variable inside a section loop: 00389, Mike Potter |
| Previous by Thread: | [SMARTY] file namei: 00389, Neeraj Rattu |
| Next by Thread: | RE: [SMARTY] ??Cannot Instantiate None Existent Class???: 00389, Hoffman, Geoffrey |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |