Created
August 21, 2013 20:53
-
-
Save philwinkle/6300135 to your computer and use it in GitHub Desktop.
Helper for Marty Wallace http://magento.stackexchange.com/questions/7019/custom-form-template-yesno-select-box-html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Marty_Package_Helper_Data extends Mage_Core_Helper_Abstract | |
{ | |
public function getYesnoHtml() | |
{ | |
$options = Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray(); | |
//if outside of a controller or block, use Mage::app()->getLayout() | |
return $this->getLayout()->createBlock('core/html_select') | |
->setName($name) | |
->setId($attribute->getAttributeCode()) | |
->setTitle($this->getAttributeLabel($attribute)) | |
->setExtraParams("") | |
->setValue($this->getAttributeValue($attribute)) | |
->setOptions($options) | |
->getHtml(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment