/views/plugins/function.label.php

https://github.com/sevkialacatli/CakeSmarty · PHP · 21 lines · 13 code · 8 blank · 0 comment · 1 complexity · 43c9bb23524212c50f29eefd0e7e13c5 MD5 · raw file

  1. <?php
  2. function smarty_function_label($params, $template) {
  3. if (empty($template->smarty->view->loaded['form'])) {
  4. trigger_error("{label} command requires Form helper.", E_USER_ERROR);
  5. }
  6. $name = 'foo';
  7. $text = null;
  8. extract(compact('template') + $params);
  9. unset($params['name']);
  10. unset($params['text']);
  11. $form = $template->smarty->view->loaded['form'];
  12. return $form->label($name, $text, $params);
  13. }