I’m using CodeIgniter, and will likely use their template library as I want to keep things extremely simple to use. The content for the template variables will come from the database, but I want the business admins to know what content areas are available. Basically the names of the parameters when they choose a specific template. For instance, Joomla uses an extra XML file that defines each area, whereas WordPress uses comments within a page template to inform the system that the PHP file is a template. I like the Joomla approach because you don’t have to parse the PHP file to find the areas, but I like the WordPress approach because you don’t have an extra XML file associated with every template. Are there other approaches that I’m missing?
Share
I think the nicest way would be to add a small hack to the template parser class. The code looks quite readable and clean in system/libraries/Parser.php. You could insert a hook in that class that can be used to keep track of the variables. I don’t know, if it works, but here’s a snippet: