/views/plugins/function.error.php
PHP | 20 lines | 13 code | 7 blank | 0 comment | 1 complexity | c4b98a0822d1e1d7d334f25d52d4a471 MD5 | raw file
Possible License(s): LGPL-3.0
- <?php
- function smarty_function_error($params, $template) {
- if (empty($template->smarty->view->loaded['form'])) {
- trigger_error("{error} command requires Form helper.", E_USER_ERROR);
- }
-
- $name = 'foo';
- $text = null;
-
- extract(compact('template') + $params);
-
- unset($params['name']);
- unset($params['text']);
-
- $form = $template->smarty->view->loaded['form'];
-
- return $form->error($name, $text, $params);
- }