Re: PHP Template (smarty)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Markus wrote:
> 
> please give me some enlightment, i'm on searching why template engine
> should use str_replace() function. (read tpl files, find & replace
> {tag}, include tpl file to php file).
> 

I can think of two reasons they use str_replace(), (1) that's how it's 
done in other languages, Perl, etc., so the technique was borrowed 
(unnecessarily) for PHP; and (2) it allows some measure of security in 
the templates, i.e., PHP code is not allowed so there's less concern for 
malicilous code being added. Smarty documentation talks about using 
Smarty to allow end users to build web pages by contructing their own 
templates. Those would be the users that you don't want to be able to 
add native PHP code to pages.

Someone stated that Savant was using str_replace(), I see it only in the 
plugins not the base class. The plugin classes are not required to use 
Savant. For my work I use the template class provided by Brian Lozer 
http://www.massassi.com/php/articles/template_engines/


Sheila






PHP Data object relational mapping generator - http://www.meta-language.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux