Re: [SMARTY] start end tags patch
| From: | Monte Ohrt | Date: | Tue, 02 Jul 2002 13:19:48 +0000 |
| Subject: | Re: [SMARTY] start end tags patch | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5160@lists.php.net to get a copy of this message | ||
Pupeno wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 02 July 2002 01:11, Monte Ohrt wrote:Why not comment out the parts you want ignored? {* <form> *} <input type="text" \> {* </form> *} Also, you can pass parameters to your menu.html file to control the colors dynamically: {include file="menu.html" bgcolor="#000000" fontcolor="#ffffff"} I don't want to add any new syntax to Smarty unless it is absolutely warranted. If I did this, then we consume the function namespace for {start} and {end}, not to mention that it doesn't follow the tag pair conventions of Smarty. Tag pairs should be the same name, such as {block}{/block} MonteExactly what is this for?I posted some time ago the way I used to work and this make it posible. The idea is to work with subtemplates, I have an index.html for all the pages so all the pages contain the same headers and layout, for example, that page includes the cascade style sheet, some javascript, everything for all the page, create som divs to show the menu, etc, etc... but the menu is not in that page because the menu is language dependant, so, the menu is in en/menu.html for example, so that page includes en/menu.html (in fact $lang/menu.html and $lang contains the language to be used). The start and end tags helps to edit that menu.html because headers are really important, Dreamweaber for example knows if it's HTML, or XHTML acording to the header, the encoding... and supouse that the menu is going to have a black background so, the font in the menu.html is white, if you don't have some enclosing formating that makes the background black, it will be imposible to work, but you can't just write put that code in the menu.html because the real formating is in the index.html, so you just put something that helps you coding outside the start and end tags and smarty won't process it, it will be ignored. I have, for example, developed a very advanced wizard engine in PHP that let's me make a wizard very fast, it uses this start and end tag because there's a wizard.html that makes the form, including the buttons at the bottom of the form, frames and that kind of things, and the diferent contents of the diferent steps are read from other files, but that other files contain forms, Dreamweaber or any good WYSIWYG editor won't allow you to insert forms object if you're not inside a form, so start and end tags solve this: <form> {start} <input type="text" /> {end} </form>