Added by anonymous on 2008-10-22 19:23:11 Download/View
- class ujform extends form {
- {
- self::$errors = $errors;
- self::$lang_key = $lang_key;
- $action = $attr['action'];
- return parent::open($action, $attr, $hidden);
- }
- {
- return '';
- $output = '<div class="form_errors"><h3>'.$title.'</h3><ul>';
- foreach(self::$errors AS $key => $error)
- {
- $error = Kohana::lang(self::$lang_key.'.'.$key.'.'.$error);
- $output .= '<li>'.html::anchor(Router::$complete_uri.'#'.$key, $error).'</li>';
- }
- return $output.'</ul></div>';
- }
- {
- // Do we need to call Kohana::lang()?
- {
- // Use the name if we have one
- }
- else
- {
- $field_name = $data;
- }
- // Display the errors
- $text = '<a name="'.$field_name.'">'.$text.'</a> - <span class="error">'.Kohana::lang(self::$lang_key.'.'.$field_name.'.'.self::$errors[$field_name]).'</span>';
- return parent::label($data, $text, $extra);
- }
- }