|
||||||||||||||||||||||
|
||||||||||||||||||||||
June 20, 2008 Another misguided individual, benny, put some rather pointless opinions about Zend Framework on my blog post. I replied to them, here, in a new blog entry: > It probably took you lots of time to rant about this why not use the time more productively? In my defense, I had been coding in Rails all that day, so my increased productivity had me out ahead of the game. In short, I had the time to spare. Thanks for your concern all the same.
> class Zend_View_Extended extends Zend_View_Abstract
> {
> protected function _run()
> {
> while( list( $k, $v ) = each( $this ) ) ${$k} = $v;
>
> include func_get_arg(0);
> }
> }
>
> class Zend_Controller_SuperAction extends Zend_Controller_Action
> {
>
> function __set($name, $value)
> {
> $this->view->{$name} = $value;
> }
> }
>
> This solves all your problems (even using some of your code) of item 2.
That's precisely my point. A "good" framework wouldn't require me to "solve the problem" at all. Local view variables should already be in local scope in the view. Do you enjoy prefixing every view variable with $this-> ? I almost feel sorry for you.. almost. > $this->getRequest()->isXMLHTTPRequest() solves another one, writing Ajax > Form Submits, POST or GET via a good library on your own takes exactly the > same time than writting them for any View Helper, which actually just > represents the same function call just in its respective language. So why > bother about this topic? Because in a good framework like Ruby on Rails it's just: if request.xhr? Looks pretty sweet compared to this abomination: if( $this->getRequest()->isXMLHTTPRequest() ) I dunno about you benny, but to me, one of those looks a hell of a lot easier to type than the other :) > Additionally most people get along better with one or the other javascript > library, so I am quite happy to decide which one i can use with ZF. Extending > the View Object with another "javascript" helper to wrap your favourite > libraries functions into PHP would probably also take just a little bit. I like a framework that helps me do less work, not one that requires me to fill in the gaps where functionality is missing. Rails already supports all the popular Javascript frameworks. So choosing which one or the other to use is only that, a choice.. no headaches integrating anything, it's already there, right now, today.
Bet all you want.. By: Greg Donald <gdonald at gmail dot com> Posted: 1 month ago Rails is already deployed on hundreds of high-traffic sites: PHP will soon become a legacy platform By: Kris Day <kdidriksson at gmail dot com> Posted: 1 month ago Hello,
|
|
|||||||||||||||||||||
|
||||||||||||||||||||||
I'm too lazy to title my comment
By: benny <benny at whitewashing dot de>
Posted: 1 month ago
Since i use ZF quite alot, writing all those shortcuts once and using them ever since is cool for me. Referring to the abomination of XML Request testing, you could extend your Zend_Controller_SuperAction to include a function xhr():
function xhr() {
return $this->getResponse()->isXmlHttpRequest();
}
then: if($this->xhr()): is even shorter than the ruby implementation.
Of course this time you would have to solve the problem again, but you have to admit it does not kill anybody.
Why does ZF not include such shortcuts? I don't know, i am not a ZF developer. You're right, Rails does a much better job at giving a hand in rapid application development, but I bet ZF scales much better on huge applications that need tailor made functionality. When I want to develop a simple web application with RAD, I can still use Rails, Symfony or Cake.