本文整理匯總了PHP中Varien_Data_Form_Element_Select::setForm方法的典型用法代碼示例。如果您正苦於以下問題:PHP Varien_Data_Form_Element_Select::setForm方法的具體用法?PHP Varien_Data_Form_Element_Select::setForm怎麽用?PHP Varien_Data_Form_Element_Select::setForm使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Varien_Data_Form_Element_Select
的用法示例。
在下文中一共展示了Varien_Data_Form_Element_Select::setForm方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testGetElementHtmlContainsScriptTag
public function testGetElementHtmlContainsScriptTag()
{
$element = new Varien_Data_Form_Element_Select();
$element->setForm(new Varien_Object());
$block = new Netresearch_OPS_Block_System_Config_Mode();
$html = $block->render($element);
$this->assertTrue(preg_match('/<script/', $html) > 0);
}
示例2: _renderCellTemplate
/**
* Render array cell for prototypeJS template
*
* @param string $columnName
* @return string
*/
protected function _renderCellTemplate($columnName)
{
if ($columnName == 'value' && isset($this->_columns[$columnName])) {
$element = new Varien_Data_Form_Element_Select();
$element->setForm($this->getForm())->setName($this->_getCellInputElementName($columnName))->setHtmlId($this->_getCellInputElementId('#{_id}', $columnName))->setValues(Mage::getModel('Mage_Core_Model_Design_Source_Design')->getAllOptions(false));
return str_replace("\n", '', $element->getElementHtml());
}
return parent::_renderCellTemplate($columnName);
}
示例3: _toHtml
/**
* @return string
*/
protected function _toHtml()
{
$htmlId = $this->getColumnName() . '#{_id}';
$select = new Varien_Data_Form_Element_Select(array('html_id' => $htmlId, 'no_span' => TRUE, 'name' => $this->getInputName()));
$select->addData($this->getColumn());
$select->setForm(new Varien_Object());
$select->setValues($this->getValues());
// Escape properly and use javascript to set the selected values
return str_replace(array("\n", '"', '/'), array('', '\\"', '\\/'), "\n {$select->getElementHtml()}\n <script type=\"text\\/javascript\">\n \$(\"{$htmlId}\").setValue(\"#{{$this->getColumnName()}}\");\n </script>\n ");
}
示例4: render
public function render(Varien_Data_Form_Element_Abstract $element)
{
$__html = '';
if (!Mage::app()->isSingleStoreMode()) {
$__replacingElement = new Varien_Data_Form_Element_Select();
$__replacingElement->setData($element->getData());
$__replacingElement->setForm($element->getForm());
$__html = parent::render($__replacingElement);
}
return $__html;
}
示例5: setForm
/**
* Set form to quantity element in addition to current element
*
* @param $form
* @return Varien_Data_Form
*/
public function setForm($form)
{
$this->_qty->setForm($form);
return parent::setForm($form);
}
示例6: getFormattersHtml
public function getFormattersHtml($name, $value = null)
{
$element = new Varien_Data_Form_Element_Select();
$element->setForm(new Varien_Object())->setValue($value)->setName($name)->setValues(array('' => Mage::helper('rule')->__('Default'), 'intval' => Mage::helper('rule')->__('Integer'), 'price' => Mage::helper('rule')->__('Price'), 'strip_tags' => Mage::helper('rule')->__('Strip Tags')));
return $element->getElementHtml();
}
示例7: _getSelect
protected function _getSelect($name, $value, $extra, $values)
{
$element = new Varien_Data_Form_Element_Select();
$element->setForm(new Varien_Object())->setValue($value)->setName($name)->addData($extra)->setValues($values);
return $element->getElementHtml();
}