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

/views/plugins/function.isfielderror.php

https://github.com/sevkialacatli/CakeSmarty
PHP | 19 lines | 11 code | 8 blank | 0 comment | 1 complexity | d91e0f7344452b9c3607147cb381ec9c MD5 | raw file
Possible License(s): LGPL-3.0
  1. <?php
  2. function smarty_function_isfielderror($params, $template) {
  3. if (empty($template->smarty->view->loaded['form'])) {
  4. trigger_error("{isfielderror} command requires Form helper.", E_USER_ERROR);
  5. }
  6. $name = 'foo';
  7. extract(compact('template') + $params);
  8. unset($params['name']);
  9. $form = $template->smarty->view->loaded['form'];
  10. return $form->isfielderror($name);
  11. }