Re: critique this code please

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

 



Sebastian wrote:

i have this small function for a template system (if you want to call it
that ;)

my idea was having something simple to separate html code from php and i
think using something like smarty is too big for me and i really dont have
time to learn to use it. so i have this code here:

http://www.cstrike-planet.com/function.phps

i call this function which reads .tpl files which contain html and some
$vars, then in my pages use something like:

eval('echo("' . template('home_index') . '");');

unfortunaly my site has grown since and im not sure if this is causing an
extra overhead on the site..
is there a way to 'improve' this small function?

thanks for any help.
sure it has some overhead. However, you'd need a seriously large site to even notice it. The same way of templating is used by XMB (a message board system). It's quite widespread, and some of the boards are quite large, generating a lot of traffic, and are heavily used. However, such a relativly small thing doesn't have that big an impact on speed AFAICS :)

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux