-
Notifications
You must be signed in to change notification settings - Fork 26
Sparks
[size=4]Sparks: The caching view library[/size]
[b]Goals[/b]
Sparks is a view library designed to solve two problems:
-
Fine grained cacheablity. Caching in CI is an all or nothing affair. Sparks gives you the ability to divide your PHP blocks into those that are cacheable and those that are not. For example: Many sites display "You are logged in as XXX" in teh top corner. This username must be regenerated for each view (from the session data), however the rest of the page may be cacheable.
-
Including views within views (parts). Also automatically wrap view files in "wrapper templates".
[b]Usage[/b]
Write your templates with the following syntax:
[code] <?php echo('This block is cachable'); ?> <$?php echo('This block is not cachable'); ?$> [/code]
Thus, non-cacheable PHP blocks have an extra $ in the start and end tags.