ZF-7939: Dojo bootstraping by resource plugin (Zend_Application_Resource_Dojo)

Description

It will resource plugin that helps automate Dojo bootstraping to ZF application.

For integrating Dojo only need it add to application.ini (or other config):

resources.dojo.djConfig.isDebug = 1 resources.dojo.djConfig.parseOnLoad = 1 resources.dojo.cdnVersion = "1.3.2" resources.dojo.localPath = "/js/dojo-toolkit/dojo/dojo.js" resources.dojo.requireModule[] = "dojo.io.script" resources.dojo.requireModule[] = "dojo.fx" ... and other settings available for setting in Zend_Dojo_View_Helper_Dojo_Container

Comments

Realisation of resource plugin will be much ease with setOptions method that proxies values to setters of container

Matthew; I just assigned this issue to me so I can do it this weekend. After that I'll ask you for review (assuming you even want it in ZF).

Dolf -- sure. Note that this issue is dependent on ZF-7938 -- completing that makes this issue trivial to accomodate.

  1. In Zend/Application/Resource/Dojo.php on 62 line you call Zend_Dojo but dint require_once 'Zend/Dojo.php'. Is it normally for Zend_Application_Resource_* classes?

  2. What about useProgrammatic option? I wrote about it in #ZF-7939.

Georgy: yes -- since autoloading is in play whenever you use Zend_Application, there's no need for the various Zend_Application_* classes to have require_once statements on their dependencies.

RE: useProgrammatic option -- yes, if it's not available via the resource, it should be. Dolf -- have you addressed this?

Dolf,

in DojoTest.php


if (!defined('PHPUnit_MAIN_METHOD')) {
    define('PHPUnit_MAIN_METHOD', 'Zend_Application_Resource_LayoutTest::main');
}
...
if (PHPUnit_MAIN_METHOD == 'Zend_Application_Resource_LayoutTest::main') {
    Zend_Application_Resource_LayoutTest::main();
}

Are you realy shure that you testing Zend_Application_Resource_Dojo ? :)

Guess I copy/pasted just a bit too much. Thank you for reporting, will do within 24 hours, I think.

Dolf, in the end of a file even now there is a code


if (PHPUnit_MAIN_METHOD == 'Zend_Application_Resource_LayoutTest::main') {
    Zend_Application_Resource_LayoutTest::main();
}

I'm blind obviously. Thank you for checking it out ;)