* @package tao */ abstract class tao_helpers_form_elements_Template extends tao_helpers_form_FormElement { // --- ASSOCIATIONS --- // --- ATTRIBUTES --- /** * the template parth * * @access protected * @var string */ protected $path = ''; /** * Short description of attribute values * * @access protected * @var array */ protected $values = []; /** * The prefix is used to recognize the form fields inside the template. * So, all the field's name you want to retreive the value should be * * @access protected * @var string */ protected $prefix = ''; /** * Short description of attribute variables * * @access protected * @var array */ protected $variables = []; // --- OPERATIONS --- /** * Se the template file path * * @access public * @author Bertrand Chevrier, * @param string path * @return mixed */ public function setPath($path) { $this->path = $path; } /** * set the values of the element * * @access public * @author Bertrand Chevrier, * @param array values * @return mixed */ public function setValues($values) { if (is_array($values)) { $this->values = $values; } } /** * Get the values of the element * * @access public * @author Bertrand Chevrier, * @return taoResults_models_classes_aray */ public function getValues() { $returnValue = null; $returnValue = $this->values; return $returnValue; } /** * Short description of method getPrefix * * @access public * @author Bertrand Chevrier, * @return string */ public function getPrefix() { $returnValue = (string) ''; //prevent to use empty prefix. By default the name is used! if (empty($this->prefix) && !empty($this->name)) { $this->prefix = $this->name . '_'; } $returnValue = $this->prefix; return (string) $returnValue; } /** * Short description of method setPrefix * * @access public * @author Bertrand Chevrier, * @param string prefix * @return mixed */ public function setPrefix($prefix) { $this->prefix = $prefix; } /** * Short description of method setVariables * * @access public * @author Bertrand Chevrier, * @param array variables * @return mixed */ public function setVariables($variables) { if (!is_array($variables)) { $variables = [$variables]; } $this->variables = $variables; } }