本文整理汇总了PHP中Zend_Form_Element::getDecorators方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element::getDecorators方法的具体用法?PHP Zend_Form_Element::getDecorators怎么用?PHP Zend_Form_Element::getDecorators使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element
的用法示例。
在下文中一共展示了Zend_Form_Element::getDecorators方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addElement
/**
* Add element to stack
*
* @param \Zend_Form_Element $element
* @return \Zend_Form_DisplayGroup
*/
public function addElement(\Zend_Form_Element $element)
{
$decorators = $element->getDecorators();
$decorator = array_shift($decorators);
$element->setDecorators(array($decorator, array('Description', array('class' => 'description')), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element')), array('Label'), array(array('labelCell' => 'HtmlTag'), array('tag' => 'td', 'class' => 'label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'class' => $this->_alternate))));
return parent::addElement($element);
}
示例2: getDecorators
/**
* Retrieve all decorators
*
* @throws ZendX_JQuery_Form_Exception
* @return array
*/
public function getDecorators()
{
$decorators = parent::getDecorators();
if (count($decorators) > 0) {
// Only check this if there are decorators present, otherwise it could
// be that the decorators have not been initialized yet.
$foundUiWidgetElementMarker = false;
foreach ($decorators as $decorator) {
if ($decorator instanceof ZendX_JQuery_Form_Decorator_UiWidgetElementMarker) {
$foundUiWidgetElementMarker = true;
}
}
if ($foundUiWidgetElementMarker === false) {
require_once "ZendX/JQuery/Form/Exception.php";
throw new ZendX_JQuery_Form_Exception("Cannot render jQuery form element without at least one decorator " . "implementing the 'ZendX_JQuery_Form_Decorator_UiWidgetElementMarker' interface. " . "Default decorator for this marker interface is the 'ZendX_JQuery_Form_Decorator_UiWidgetElement'. " . "Hint: The ViewHelper decorator does not render jQuery elements correctly.");
}
}
return $decorators;
}
示例3: testCanDisableRegisteringDefaultDecoratorsDuringInitialization
public function testCanDisableRegisteringDefaultDecoratorsDuringInitialization()
{
$element = new Zend_Form_Element('foo', array('disableLoadDefaultDecorators' => true));
$decorators = $element->getDecorators();
$this->assertEquals(array(), $decorators);
}