Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

XML Config file format

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
hinrichs
Smarty Rookie


Joined: 24 Apr 2003
Posts: 28
Location: San Francisco, CA

PostPosted: Fri Apr 21, 2006 5:16 am    Post subject: XML Config file format Reply with quote

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
View user's profile Send private message Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Fri Apr 21, 2006 5:11 pm    Post subject: Reply with quote

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 Smile)

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 Wink
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP