Let me start this post with the announcement that even before the first official release of my own set of components, I've already changed their name, or their namespace prefix, if you will. As someone who commented on one of my previous entries has
pointed out, "eZeAR" looked pretty ugly and was hard to type. Having to type it a few times myself since I came up with it, I had to agree. So everything's now prefixed with the much easier CWAC. It also sounds a lot sillier when pronounced (imagine a duck...), and I like silly. So there you have it. Who can guess what CWAC stands for?

But now for something completely different: The topic at hand. Today, ladies and gentlemen, I'd like to talk about beefing up the most central component of the Zend_Frameworks MVC package: Zend_Action_Controller.
The Controller basically is a class wherein you define one method for each individual action you want the controller to perform. Which controller and action is being called is deduced from the URL you've typed into your browser. For example:
http://my.cool.app/image/show/7
...would cause the method "showAction" in the controller class "ImageController" to be called.
That's all good and well, but this is where automation currently ends in the Zend Framework. Everything else has to be done by hand. If you wanted to have the output for your action being displayed within a fancy template, you're on your own. Make an instance of the Zend_View class (or a preferred template engine of your choice), specify path to your templates, assign variables, specify the actual template to use, output the result. Rinse, repeat for every damn action in your controller. Does that sound redundant and inconvenient to you? It sure does to me.
Luckily, the strength of the Zend Framework is that it is very easily customizable. So let's make this a bit more convenient...
Recent Comments