|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
hinrichs Smarty Rookie
Joined: 24 Apr 2003 Posts: 28 Location: San Francisco, CA
|
Posted: Fri Apr 21, 2006 5:16 am Post subject: XML Config file format |
|
|
I had never looked into using smarty's config file feature. It is very nice and would seem to work well for an instance where you could keep the vital data for a template (when it isn't in a database) in a config file where someone could easily edit it without dealing with the html and presentation logic around it.
The config file feature is able to be fully grasped in minutes. But it not very sophisticated. Wouldn't xml give you a lot more to work with, plus a more standard and reusable way of storing this kind of data, plus into the future, a way to add additional cool features to smarty?
I understand this could bloat smarty if it had to have its own xml-to-data converter, though perhaps simplexml could be used, assuming php5 is available?
Of course, no problem to just code this yourself--throw the xml into an array and pass it into the template. Or use xslt. But just looking at the config feature, I was wondering if it would not be an easy way to jazz up that feature. _________________ Robert Hinrichs
CTO ISL Consulting
http://www.islco.com
http://www.bobisfamous.com |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Fri Apr 21, 2006 5:11 pm Post subject: |
|
|
You could provide a custom Config_XML class to replace Config_File. There are issues, of course, on how to represent XML data in a convenient way. I think I would prefer a YAML format (maybe because that's what I already use )
Still, I think config files should be abandoned. They introduce a second form of data addressing (#var#) and a second source of data where I think all data supplied to templates should arrive via an assign().
That's just my 2c on this topic |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|