Exemple #1
0
 public function open(array $options = [])
 {
     $attributes['action'] = $this->helper->getAction($options);
     $attributes['method'] = $this->helper->getMethod($options);
     $attributes['accept-charset'] = 'UTF-8';
     if (isset($options['files']) && $options['files']) {
         $options['enctype'] = 'multipart/form-data';
     }
     $attributes = array_merge($attributes, $this->helper->array_except($options, $this->reserved));
     list($message, $attributes) = $this->helper->generateAttributes($attributes);
     return "<form {$attributes}>";
 }
Exemple #2
0
 public function open($legend, array $options = [])
 {
     $attributes['action'] = $this->helper->getAction($options);
     $attributes['method'] = $this->helper->getMethod($options);
     $attributes['accept-charset'] = 'UTF-8';
     $this->class = $options['class'];
     $this->jsValidateFunction = $options['jsValidateFunction'];
     if (isset($options['files']) && $options['files']) {
         $options['enctype'] = 'multipart/form-data';
     }
     if (isset($options['validateElements']) && $options['validateElements']) {
         $this->validateElements = implode(',', $options['validateElements']);
         unset($options['validateElements']);
     }
     $attributes = array_merge($attributes, $this->helper->array_except($options, $this->reserved));
     list($message, $attributes) = $this->helper->generateAttributes($attributes);
     if ($legend) {
         $legend = '<legend>' . $legend . '</legend>';
     }
     $this->setString($legend . "\n\n" . "<form   {$attributes}>");
 }