本文整理汇总了PHP中Varien_Data_Form_Element_Abstract::getRequired方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Form_Element_Abstract::getRequired方法的具体用法?PHP Varien_Data_Form_Element_Abstract::getRequired怎么用?PHP Varien_Data_Form_Element_Abstract::getRequired使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Data_Form_Element_Abstract
的用法示例。
在下文中一共展示了Varien_Data_Form_Element_Abstract::getRequired方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareElementHtml
public function prepareElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$config = $this->getConfig();
$chooseButton = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button')->setClass('scalable btn-chooser')->setLabel($config['button']['open'])->setOnclick('MediabrowserUtility.openDialog(\'' . $this->getUrl('*/cms_wysiwyg_images/index', array('target_element_id' => $element->getName())) . '\')')->setDisabled($element->getReadonly());
$text = new Varien_Data_Form_Element_Text();
$text->setForm($element->getForm())->setId($element->getName())->setName($element->getName())->setClass('widget-option input-text');
if ($element->getRequired()) {
$text->addClass('required-entry');
}
if ($element->getValue()) {
$text->setValue($element->getValue());
}
$element->setData('after_element_html', $text->getElementHtml() . $chooseButton->toHtml());
return $element;
}
示例2: render
public function render(Varien_Data_Form_Element_Abstract $element)
{
$controller = Mage::app()->getRequest()->getControllerName();
//Check current page is pagebuilder
if ($controller == 'widget_instance') {
$value = $element->getValue();
} else {
$value = base64_decode($element->getValue());
}
$class = '';
if ($element->getRequired()) {
$class = 'required-entry';
}
$useContainerId = $element->getData('use_container_id');
return '<tr class="system-fieldset-sub-head-tabs" id="row_' . $element->getHtmlId() . '"><td class="label"><label for="' . $element->getHtmlId() . '">' . $element->getLabel() . '</label></td>
<td class="value"><textarea id="' . $element->getHtmlId() . '" name="' . $element->getName() . '" class="textarea ' . $class . '" rows="2" cols="15">' . $value . '</textarea><button id="id_' . $element->getHtmlId() . '" title="WYSIWYG Editor" type="button" class="scalable btn-wysiwyg" onclick="productlistWysiwygEditor.open(\'' . Mage::helper("adminhtml")->getUrl('adminhtml/catalog_product/wysiwyg') . '\', \'' . $element->getHtmlId() . '\')" style=""><span><span><span>WYSIWYG Editor</span></span></span></button></td></tr>';
}
示例3: _getFieldInput
/**
* @param Varien_Data_Form_Element_Abstract $element
* @return Varien_Data_Form_Element_Text
*/
protected function _getFieldInput(Varien_Data_Form_Element_Abstract $element)
{
$fieldInput = new Varien_Data_Form_Element_Text();
$fieldInput->setForm($element->getForm())->setId($element->getId())->setName($element->getName())->setClass('widget-option input-text');
if ($element->getRequired()) {
$fieldInput->addClass('required-entry');
}
if ($element->getValue()) {
$fieldInput->setValue($element->getValue());
}
return $fieldInput;
}