* @package tao */ class tao_helpers_form_elements_template_Template extends tao_helpers_form_elements_Template { // --- ASSOCIATIONS --- // --- ATTRIBUTES --- // --- OPERATIONS --- /** * Short description of method feed * * @access public * @author Joel Bout, * @return mixed */ public function feed() { $values = []; $prefix = preg_quote($this->getPrefix(), '/'); foreach ($_POST as $key => $value) { if (preg_match("/^$prefix/", $key)) { $values[str_replace($this->getPrefix(), '', $key)] = $value; } } $this->setValues($values); } /** * Short description of method render * * @access public * @author Joel Bout, * @return string */ public function render() { $returnValue = (string) ''; if (file_exists($this->path) && is_readable($this->path)) { extract($this->variables); ob_start(); common_Logger::i('including \'' . $this->path . '\' into form', ['TAO']); include $this->path; $returnValue = ob_get_contents(); ob_end_clean(); //clean the extracted variables foreach ($this->variables as $key => $name) { unset($$key); } } return (string) $returnValue; } /** * Short description of method getEvaluatedValue * * @access public * @author Joel Bout, * @return mixed */ public function getEvaluatedValue() { return $this->getValues(); } }