Welcome Guest, Not a member yet? Register   Sign In
Combine CodeIgniter with Smarty
#15

[eluser]Edemilson Lima[/eluser]
Quote:The quote you referenced above points out that although the cache file has a .php extension, it isn’t an executable php file.

"Although they end in the .php extention, they are not intended to be directly executable."

These files are PHP files and can be executable, but is not intended to be, because they are called by the template engine, under the right path. If somebody call them in the cache path, it will execute, but will not work.

Quote:both CI and Smarty read the entire cache file and parse metadata from it.

In this aspect they work pretty the same, altought Smarty have more features.

Quote:Smarty’s cache implementation is much more powerful than CI’s. While CI only allows caching per page (all or nothing), Smarty allows partial caching.

In this case, I agree it is better. I am not saying Smarty don't have its merits.

What I understood from your examples, is that Smarty takes the template file, produces a compiled PHP file and stores it in the template cache. Then it produces the cache file from it, right? Well, if it does, then it really have a cache like CI, with the rendered HTML. In this case, does it have two cache folders? One for PHP compiled files and another one for rendered HTML files? I have a web site with Smarty, but I never saw such rendered HTML files in the cache folder. May the Smarty version is too old, I don't know. The credits says it is 2.6.6.

"On the next call to display('index.tpl'), the cached copy will be used instead of rendering the template again."

As far I understand, Smarty have a template cache, not a content cache. May I am wrong, but in any case, it is better to write a view with pure PHP than write a template that will be parsed and then executed to produce the content cache. You will always gain performance if you cut off one step. Don't you? And also you will save a lot of server memory if you don't load a huge unnecessary library. Isn't that true?


Messages In This Thread
Combine CodeIgniter with Smarty - by El Forum - 12-15-2007, 01:21 PM
Combine CodeIgniter with Smarty - by El Forum - 12-15-2007, 01:32 PM
Combine CodeIgniter with Smarty - by El Forum - 12-15-2007, 02:10 PM
Combine CodeIgniter with Smarty - by El Forum - 12-16-2007, 10:39 AM
Combine CodeIgniter with Smarty - by El Forum - 01-04-2008, 05:42 AM
Combine CodeIgniter with Smarty - by El Forum - 01-04-2008, 12:36 PM
Combine CodeIgniter with Smarty - by El Forum - 01-19-2008, 05:39 AM
Combine CodeIgniter with Smarty - by El Forum - 01-19-2008, 06:06 AM
Combine CodeIgniter with Smarty - by El Forum - 01-19-2008, 11:44 AM
Combine CodeIgniter with Smarty - by El Forum - 01-19-2008, 02:32 PM
Combine CodeIgniter with Smarty - by El Forum - 01-20-2008, 04:55 AM
Combine CodeIgniter with Smarty - by El Forum - 01-20-2008, 12:09 PM
Combine CodeIgniter with Smarty - by El Forum - 01-20-2008, 06:32 PM
Combine CodeIgniter with Smarty - by El Forum - 01-21-2008, 12:34 AM
Combine CodeIgniter with Smarty - by El Forum - 01-21-2008, 05:23 AM
Combine CodeIgniter with Smarty - by El Forum - 01-21-2008, 10:56 AM
Combine CodeIgniter with Smarty - by El Forum - 01-21-2008, 03:44 PM
Combine CodeIgniter with Smarty - by El Forum - 01-21-2008, 04:34 PM
Combine CodeIgniter with Smarty - by El Forum - 09-01-2008, 01:46 AM
Combine CodeIgniter with Smarty - by El Forum - 10-18-2008, 08:45 PM
Combine CodeIgniter with Smarty - by El Forum - 07-02-2009, 09:29 AM
Combine CodeIgniter with Smarty - by El Forum - 07-02-2009, 11:29 AM
Combine CodeIgniter with Smarty - by El Forum - 05-10-2012, 11:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB