Plesk

Implement Form

Every form should be an instance of
pm_Form_Simple ,
so that it looks the same as other forms in Plesk. For most cases, you
can use the same features as for
Zend_Form.
Namely, you can:

Step 1. Specify elements

Basically, you should add elements to the form using the
addElement
method. There are several standard
elements
,
like “text” or “select”, and they have the same flexibility as
Zend_Form, including the ability to specify
decorators
for complex elements:

public function formAction()
{
    $form = new pm_Form_Simple();
    $form->addElement('text', 'exampleText', [
        'label' => 'Example Text',
        'value' => 'Default value',
        'required' => true,
    ]);
}

On a page, it will look like this:

Step 2. Specify buttons

You have the ability to customize what the buttons below the form will
look like using the
addControlButtons
method:

<pre…
Exit mobile version