Re: [SMARTY] start end tags patch

From: Date: Tue, 02 Jul 2002 20:56:57 +0000
Subject: Re: [SMARTY] start end tags patch
References: 1 2 3 4  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-5165@lists.php.net to get a copy of this message
This would probably work better as a prefilter. Your template would look something like this: <?xml version="1.0" encoding="UTF-8"?> <form ...> {PAGE_START} {PAGE_END} </form> In your prefilter, have it grab everything between {PAGE_START} and {PAGE_END}, discarding everything else. Drop the prefilter into the plugin directory and register it in your application. Now we have avoided adding more logic (and execution time) to the core of Smarty for something that would be rarely used. And as a bonus for you, this only gets executed once at compile time of your template. Monte Pupeno wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 02 July 2002 09:19, Monte Ohrt wrote:
Why not comment out the parts you want ignored? {* <form> *} <input type="text" \> {* </form> *}
Because the first line in a well formed XHTML has to be something like <?xml version="1.0" encoding="UTF-8"?> followed by the doctype, if not, some WYSIWYG editors will complain and may ending scrwing up the template.
Also, you can pass parameters to your menu.html file to control the colors dynamically: {include file="menu.html" bgcolor="#000000" fontcolor="#ffffff"}
That's not enough if you take a look of what I did in my wizard engine. Arround the step files there's a form.
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}
Ok, I can change to a pair like that. It's not procesed like other pairs, it just cleans everything else before start procesiong, you don't have to put start end in your templates, if there's no start end, it is processes as it used to do. How would you like them to be call ? {proc}{/proc} ? {template}{/template} ? I didn't add that feature just because I'm rebel, I've been working with templates for years, I developed my own template library but smarty is far much better for all the things it can do, but for the way I work, I really need something like this, I tryed all the things I've found and I posted and discussed diferents approachs here. - -- Pupeno: pupeno@pupeno.com http://www.pupeno.com PS: something I've found usefull and you may also find (because I use Smarty tags a lot in Javascript and I didn't want to mess with lot' s of stricts tags) is changing the left and right delimeter to {{ }} just one more character and save you a lot of troubles. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9IenGLr8z5XzmSDQRAhqfAKDA6EeT2clim8gw6MVEEYDAYANpbACfRakR 8voSAhH6bbjLIuZnXo1/7rQ= =cKts -----END PGP SIGNATURE-----
-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.

« previous php.smarty.general (#5165) next »