本文整理汇总了PHP中Zend_Form_Element::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element::getId方法的具体用法?PHP Zend_Form_Element::getId怎么用?PHP Zend_Form_Element::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element
的用法示例。
在下文中一共展示了Zend_Form_Element::getId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderLabel
public function renderLabel(Zend_Form_Element $element, Zend_View_Interface $view)
{
$label = $element->getLabel();
if (empty($label)) {
$label = $element->getName();
}
return '<div class="pointer" onClick = goToErrorLabel(\'' . $element->getId() . '\')>' . $this->getMarkupElementLabelStart() . $view->escape($label) . $this->getMarkupElementLabelEnd() . '</div>';
}
示例2: _getDefaultElementDecorator
/**
*
* @param Zend_Form_Element $element
* @return string[]
*/
private function _getDefaultElementDecorator(Zend_Form_Element $element)
{
$decorator = array();
if ($element instanceof Zend_Form_Element_Checkbox) {
$decorator[] = array(array('Label-Open' => 'HtmlTag'), array('tag' => 'label', 'class' => 'checkbox', 'id' => $element->getId() . '-label', 'for' => $element->getName(), 'openOnly' => true));
$decorator[] = 'ViewHelper';
$decorator[] = array('CheckBoxLabel');
$decorator[] = array(array('Label-Closing' => 'HtmlTag'), array('tag' => 'label', 'closeOnly' => true));
$decorator[] = array('Errors', array('placement' => 'append'));
$decorator[] = array('Description', array('tag' => 'span', 'class' => 'help-block'));
$decorator[] = array(array('Inner-Wrapper' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-sm-10'));
$decorator[] = array(array('Outer-Wrapper' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'));
return $decorator;
}
if ($element instanceof Zend_Form_Element_Submit || $element instanceof Zend_Form_Element_Reset || $element instanceof Zend_Form_Element_Button) {
$decorator[] = 'ViewHelper';
return $decorator;
}
if ($element instanceof Zend_Form_Element_File) {
$decorator[] = 'File';
$decorator[] = 'Errors';
$decorator[] = array('Description', array('tag' => 'span', 'class' => 'input-file', 'placement' => 'prepend'));
$decorator[] = array(array('File-Wrapper' => 'HtmlTag'), array('tag' => 'span', 'class' => 'btn btn-default'));
} else {
$decorator[] = 'ViewHelper';
$decorator[] = 'Errors';
$decorator[] = array('Description', array('tag' => 'span', 'class' => 'help-block'));
}
if ($this->_type === self::TYPE_HORIZONTAL) {
$decorator[] = array(array('Inner-Wrapper' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-sm-10'));
$decorator[] = array('Label', array('class' => 'control-label col-sm-2'));
$decorator[] = array(array('Outer-Wrapper' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'));
} else {
$decorator[] = 'Label';
$decorator[] = array('HtmlTag', array('tag' => 'div', 'class' => 'form-group'));
}
return $decorator;
}
示例3: updateId
/**
* Updates the ID of the given element.
*
* @param Zend_Form_Element $element
*/
protected function updateId(Zend_Form_Element $element)
{
$currentId = $element->getId();
$newId = $currentId . '-' . uniqid();
$element->setAttrib('id', $newId);
}
示例4: decorateConfig
public function decorateConfig($content, Zend_Form_Element $element, array $options)
{
$view = $this->getView();
$value = $view->escape($element->getValue());
return '<textarea name="' . $view->escape($element->getName()) . '"' . ' class="f-max-size" readonly="readonly"' . ' id="' . $view->escape($element->getId()) . '"' . ' rows="' . (substr_count($value, "\n") + 1) . '" cols="80" style="width: 100%;"' . '>' . $value . '</textarea>';
}