Jet\Form_Definition_Interface
The interface that a class must implement if it is to be automatically mapped to forms.
Overview of methods
Method | Meaning of |
---|---|
public getFormFieldsDefinition( ) : Form_Definition_Field[] |
Returns the definitions of the form fields of the given class. |
public createForm( string $form_name, array $only_fields=[], array $exclude_fields=[] ) : Form |
By definition, it creates a form. Parameters:
Functioning of filters Both the $only_fields and $exclude_fields filters have the option to use the * character. How it works: In the previous chapter, we showed an example with a hypothetical product in an e-commerce store. Now, let's say we only need a form to edit the product descriptions and nothing else. But to edit the descriptions in all locales. Let's do it like this:
$edit_form = $product->createForm(
Or let's say we need a form that has all the basic data and also all the localized data, but only for a specific locale. This can then be done as follows:
$edit_form = $product->createForm(
And it is understandably not a problem to create a form with an exact list of fields. For example, if we need to edit only internal codes and EANs:
$edit_form = $product->createForm(
|