<?php 
class EFMultiCheckbox extends AppElementoFormularioMulti{
	public $helper = 'formMultiCheckbox';
	
	protected $_enLinea = false;
	public function  __construct($spec,$options=null){
		parent::__construct($spec, $options);
		$this->setSeparator('');
		
	}
	
	public function setEnLinea($valor){
		$this->_enLinea = $valor;
		
	}
	
	/**
	 * MultiCheckbox is an array of values by default
	 * @var bool
	 */
	protected $_isArray = true;
	
	public function renderInput(){
		
		if($this->_enLinea){
			$this->setAttrib('label_class', 'checkbox-inline');
		}
		
		
		
		$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() ,$this->_enLinea);
		} catch (Exception $e) {
			return $e->__toString();
		}
	
	}
}