<?php 
class EFRadio extends AppElementoFormularioMulti{
	public $helper = 'formRadio';
	
	
	public function  __construct($spec,$options=null){
		parent::__construct($spec, $options);
		$this->setSeparator('');
	}
	
	/**
	 * Load default decorators
	 *
	 * Disables "for" attribute of label if label decorator enabled.
	 *
	 * @return void
	 */
	public function loadDefaultDecorators()
	{
		parent::loadDefaultDecorators();
		if (false !== $decorator = $this->getDecorator('Label')) {
			$decorator->setOption('disableFor', true);
		}
	}
	
	
	public function renderInput(){
		$view = $this->getView();
		$helper = $this->getHelper();
		$attribs   = $this->getAttribs();
		if (!array_key_exists('id', $attribs)) {
			$attribs['id'] = $this->getName();
		}
		if(isset($attribs['helper'])){
			unset($attribs['helper']);
		}
		try {
			return  $view->$helper($this->getName(), $this->getValue(), $attribs, $this->getMultiOptions(),  $this->getSeparator() );
		} catch (Exception $e) {
			return $e->__toString();
		}
	
	}
}