### Options:
- type Form method defaults to autodetecting based on the form context. If
the form context's isCreate() method returns false, a PUT request will be done.
- method Set the form's method attribute explicitly.
- action The controller action the form submits to, (optional). Use this option if you
don't need to change the controller from the current request's controller. Deprecated since 3.2, use url.
- url The URL the form submits to. Can be a string or a URL array. If you use 'url'
you should leave 'action' undefined.
- encoding Set the accept-charset encoding for the form. Defaults to Configure::read('App.encoding')
- enctype Set the form encoding explicitly. By default type => file will set enctype
to multipart/form-data.
- templates The templates you want to use for this form. Any templates will be merged on top of
the already loaded templates. This option can either be a filename in /config that contains
the templates you want to load, or an array of templates to use.
- context Additional options for the context class. For example the EntityContext accepts a 'table'
option that allows you to set the specific Table class the form should be based on.
- idPrefix Prefix for generated ID attributes.
- templateVars Provide template variables for the formStart template.
public create ( mixed $model = null, array $options = [] ) : string | ||
$model | mixed | The context for which the form is being defined. Can be an ORM entity, ORM resultset, or an array of meta data. You can use false or null to make a model-less form. |
$options | array | An array of html attributes and options. |
return | string | An formatted opening FORM tag. |