/** * Set the view object * * Ensures that the view object has the dojo view helper path set. * * @param \Zend\View\ViewEngine $view * @return \Zend\Dojo\Form\Element\Dijit */ public function setView(View $view = null) { if (null !== $view) { if (false === $view->getPluginLoader('helper')->getPaths('Zend\\Dojo\\View\\Helper')) { $view->addHelperPath('Zend/Dojo/View/Helper', 'Zend\\Dojo\\View\\Helper'); } } return parent::setView($view); }
/** * Set the view object * * Ensures that the view object has the dojo view helper path set. * * @param View $view * @return \Zend\Dojo\Form\Element\Dijit */ public function setView(View $view = null) { if (null !== $view) { if (false === $view->getBroker()->isLoaded('dojo')) { $loader = new \Zend\Dojo\View\HelperLoader(); $view->getBroker()->getClassLoader()->registerPlugins($loader); } } return parent::setView($view); }
/** * Add a display group object (used with cloning) * * @param DisplayGroup $group * @param string|null $name * @return Form */ protected function _addDisplayGroupObject(DisplayGroup $group, $name = null) { if (null === $name) { $name = $group->getName(); if ('' === (string) $name) { throw new Exception\InvalidArgumentException('Invalid display group added; requires name'); } } $this->_displayGroups[$name] = $group; if (!empty($this->_displayGroupPrefixPaths)) { $this->_displayGroups[$name]->addPrefixPaths($this->_displayGroupPrefixPaths); } $this->_order[$name] = $this->_displayGroups[$name]->getOrder(); $this->_orderUpdated = true; return $this; }
public function testPassingConfigObjectToConstructorSetsObjectState() { $config = new Config($this->getOptions()); $group = new DisplayGroup('foo', $this->loader, $config); $this->assertEquals('foo', $group->getName()); $this->assertEquals('Display Group', $group->getLegend()); $this->assertEquals(20, $group->getOrder()); $this->assertEquals('foobar', $group->getAttrib('class')); }