Blog » Blog Entry

Zend Framework core developers continue to dismay

May 31, 2008

So while learning Zend Framework, I realized I would need two different doctype statements in my two different view layouts, since I would be using a frameset in my admin, but then regular XHTML everywhere else.

I found out pretty quickly I was unable to setup the proper logic directly in the view layout. I also noticed the buggy Zend Framework doctype() helper was allowing non-compliant HTML input fields to be created. So when I asked the Zend Framework developers, here's how Matthew Weier O'Phinney suggested I do it:

I'd do this in a preDispatch() plugin:

class My_Plugin_Doctype extends Zend_Controller_Plugin_Abstract
{
   public function preDispatch(Zend_Controller_Request_Abstract $request)
   {
     $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
     $viewRenderer->initView();
     $view = $viewRenderer->view;

     if (('admin' == $request->getControllerName())
         && ('index' == $request->getActionName()))
     {
       // set frameset doctype
       $view->doctype('XHTML1_FRAMESET');
     } else {
       // set regular doctype
       $view->doctype('XHTML1_STRICT');
     }
   }
}

Then, register this in your bootstrap:

$front->registerPlugin(new My_Plugin_Doctype);

Are you kidding me? An entire 19-line plugin, just for a simple if/else statement? What are these people smoking?

And just so you know, I am NOT making this up:

http://www.nabble.com/valid-html-issue-to17526822.html

Tags: zend

« How To Deploy Rails Using mod_rails On Apache Zend Framework - more stupid idiocy to deal with »

Ad hominem attacks due not suit you

By: Matthew Weier O'Phinney <mweierophinney at gmail dot com>

Posted: 2 months ago

As I've said publically on the mailing lists, attacks like these do nothing to improve the framework. Start contributing, and I'll take you seriously. How would _you_ like to do it? What would work better? And does such a solution take into account the framework architecture?

The above was taken out of context. I recommend building a plugin for bootstrapping your applications -- the above would be just one portion of that. It's much simpler than that when you don't utilize framesets, which will always require extra setup. In the use case _you_ presented, you were tying whether or not a document setup the frameset or was a document within a frameset based on the controller and action names -- and the only to know that information is _after_ routing has occurred.

I'm not going to stoop to your level and call you stupid via a mailto link. This is juvenile behavior, and hopefully others will recognize it as such as well. Build a better framework, or contribute to one you do use, but stop the personal attacks; if you're as good of a developer as you claim to be, they're beneath you.

Add a comment:

Title:

Comment:

Name:

Email: