Exemplo n.º 1
0
 public static function file($name, array $attributes = NULL)
 {
     if (!isset($attributes['id']) and self::$auto_id) {
         $attributes['id'] = 'field-' . $name;
     }
     return parent::file($name, $attributes) . PHP_EOL;
 }
Exemplo n.º 2
0
 /**
  * Creates a file upload form input.
  *
  * @param   string  input name
  * @param   string  input value
  * @param   array   html attributes
  * @return  string
  */
 public function file($name, array $attributes = NULL)
 {
     $this->load_values($name, $dummy, $attributes);
     return '<li>' . Kohana_Form::file($name, $attributes) . $this->addAlertSpan(isset($this->errors[$name]) ? $this->errors[$name] : NULL, $attributes) . '</li>';
 }
Exemplo n.º 3
0
 /**
  * Creates a file upload form input.
  *
  * @param   string  input name
  * @param   string  input value
  * @param   array   html attributes
  * @return  string
  */
 public function file($name, array $attributes = NULL)
 {
     $this->load_values($name, $dummy, $attributes);
     $result = '<li>' . Kohana_Form::file($name, $attributes);
     // add error span
     if (isset($this->errors[$name])) {
         $result .= '<span class="' . $this->error_class . '">' . ucfirst($this->errors[$name]) . '</span>';
     } else {
         if (isset($attributes['info'])) {
             // else add info span
             $result .= '<span class="' . $this->info_class . '">' . $attributes['info'] . '</span>';
         }
     }
     $result .= '</li>';
     return $result;
 }