more on savant3
As mentioned before, I’ve started playing around with Savant3 as an candidate to complement the current view code.
So far I’ve got a simple subclass (plus about 5 lines of patching in Savant.php itself) to make it usable as template wrapper.
I appreciate that it is rather simple and I can’t really follow some of the complaints about code missing compared to Savant2 (which I haven’t looked at at all).
Advantages
- Savant provides pretty much everything the current theme class has to offer. True, it doesn’t have a method to generate theme URLs, but that is easy to add by subclassing. Also, since there is a setting to configure the default view class it would be easy to switch between implementations.
- Another feature of Savant (as of version 3) is support for compiler. The default templating system (if you want) in Savant is straight PHP, sprinkled with some nice helper methods.
- However, there is support for compiler. Another word to describe this might be pre-processor. So, how is that good? Well, I guess it could be used to implement caching on block level. Considering that each sidebox is included separately, some could be cached, even if the page as a whole is not. I think Smarty does a similar thing, even though this migh be abusing the system a bit…
- I’ve mentioned that templating is just plain PHP. This would tie in with the current ZenMagick approach and could could be implemented almost transparently.
- Another nice thing is that theme inheritance is pretty much build in. Savant allows to configure as many search locations for templates as you want. Done in the right order, this behaves exactly like theme inheritance! And with much nicer code!
Beside the goodies above using Savant might have some positive side-effects on other ZenMagick code as well. For one thing, it would force me to really continue with my theme code cleanup. It might be a good time to get rid of the them info class altogether, perhaps in favour of a simple properties file?
So, I am really tempted. However, there will be more experimenting before I’ll be making a decision. Until then there is more code cleanup to be done. On the other hand I might put this into the mix while I am at it … stay tuned
