FormStack, Form, Field
The three classes you use inside ApplicationAbstract::getFormStack() to declare the settings forms the Admin UI renders.
use Hanaboso\PipesPhpSdk\Application\Model\Form\FormStack;
use Hanaboso\PipesPhpSdk\Application\Model\Form\Form;
use Hanaboso\PipesPhpSdk\Application\Model\Form\Field;
FormStack #
Top-level container. One per Application.
| Method | Purpose |
|---|---|
addForm(Form $form) | Append a Form. |
getForms() | All forms in this stack. |
Form #
A single tab in the Admin UI.
new Form(string $key, string $publicName)
| Method | Purpose |
|---|---|
addField(Field $field) | Append a field. |
getKey() / getPublicName() | Identifiers. |
getFields() | All fields on this form. |
Use the key authorization_form for credentials so the Admin UI shows it in the right tab.
Field #
A single input.
new Field(string $type, string $key, string $label, mixed $value = null, bool $required = false)
| Method | Purpose |
|---|---|
setDescription(string $text) | Help text shown next to the field. |
setReadOnly(bool $readOnly) | Render read-only. |
addChoice(mixed $value, string $label) | For SELECT / RADIO fields. |
Field type constants #
| Constant | Renders as |
|---|---|
Field::TEXT | Single-line text input. |
Field::NUMBER | Numeric input. |
Field::URL | URL input. |
Field::PASSWORD | Masked input; persisted encrypted. |
Field::SELECT_BOX | Dropdown. |
Field::CHECKBOX | Boolean toggle. |
See also #
- Development: Authentication and settings
- Node.js equivalent:
FormStack, Form, Field