Encore\Admin\Form\Builder::open PHP Method

open() public method

Open up a new HTML form.
public open ( array $options = [] ) : string
$options array
return string
    public function open($options = [])
    {
        if ($this->mode == self::MODE_EDIT) {
            $attributes['action'] = $this->form->resource() . '/' . $this->id;
            $this->form->hidden('_method')->value('PUT');
        }
        if ($this->mode == self::MODE_CREATE) {
            $attributes['action'] = $this->form->resource();
        }
        $attributes['method'] = array_get($options, 'method', 'post');
        $attributes['accept-charset'] = 'UTF-8';
        $attributes['class'] = array_get($options, 'class');
        if ($this->hasFile()) {
            $attributes['enctype'] = 'multipart/form-data';
        }
        $html = '';
        foreach ($attributes as $name => $value) {
            $html[] = "{$name}=\"{$value}\"";
        }
        return '<form ' . implode(' ', $html) . '>';
    }