public function display() { $tpl = new StringTemplate('<span # IF C_HAS_CSS_CLASSES #class="{CSS_CLASSES}"# ENDIF ## START attributs # {attributs.TYPE}="{attributs.VALUE}"# END attributs #>{CONTENT}</span>'); $tpl->put_all(array('C_HAS_CSS_CLASSES' => $this->has_css_class(), 'CSS_CLASSES' => $this->get_css_class(), 'CONTENT' => $this->content)); foreach ($this->attributs as $type => $value) { $tpl->assign_block_vars('attributs', array('TYPE' => $type, 'VALUE' => $value)); } return $tpl->render(); }
public function display() { $tpl = new StringTemplate('<img src="{URL}" # START attributs # {attributs.TYPE}="{attributs.VALUE}"# END attributs ## IF C_HAS_CSS_CLASSES #class="{CSS_CLASSES}"# ENDIF #>'); $tpl->put_all(array('C_HAS_CSS_CLASSES' => $this->has_css_class(), 'CSS_CLASSES' => $this->get_css_class(), 'URL' => $this->url)); foreach ($this->attributs as $type => $value) { $tpl->assign_block_vars('attributs', array('TYPE' => $type, 'VALUE' => $value)); } return $tpl->render(); }
public function display() { $tpl_src = '<optgroup label="${escape(LABEL)}"> # START options # # INCLUDE options.OPTION # # END options # </optgroup>'; $tpl = new StringTemplate($tpl_src); $tpl->put_all(array('LABEL' => $this->get_label())); foreach ($this->options as $option) { $tpl->assign_block_vars('options', array(), array('OPTION' => $option->display())); } return $tpl; }
private function get_html_code() { $tpl_src = '<select name="${escape(NAME)}" id="${escape(HTML_ID)}" class="${escape(CSS_CLASS)}" # IF C_DISABLED # disabled="disabled" # ENDIF # >' . '# START options # # INCLUDE options.OPTION # # END options #' . '</select>'; $tpl = new StringTemplate($tpl_src); $tpl->put_all(array('NAME' => $this->get_html_id(), 'ID' => $this->get_id(), 'HTML_ID' => $this->get_html_id(), 'CSS_CLASS' => $this->get_css_class(), 'C_DISABLED' => $this->is_disabled())); foreach ($this->get_options() as $option) { $tpl->assign_block_vars('options', array(), array('OPTION' => $option->display())); } return $tpl; }