PageRenderTime 40ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/views/plugins/function.error.php

https://github.com/sevkialacatli/CakeSmarty
PHP | 20 lines | 13 code | 7 blank | 0 comment | 1 complexity | c4b98a0822d1e1d7d334f25d52d4a471 MD5 | raw file
Possible License(s): LGPL-3.0
  1. <?php
  2. function smarty_function_error($params, $template) {
  3. if (empty($template->smarty->view->loaded['form'])) {
  4. trigger_error("{error} 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->error($name, $text, $params);
  13. }