Repository navigation
Button
Viames Marino edited this page Feb 26, 2026
·
2 revisions
Pair\Html\FormControls\Button renders <button> controls with submit/reset/button modes and form-related attributes.
-
type(string $type): selfwhere type issubmit,reset, orbutton formaction(string $url): staticformenctype(string $type): static-
formmethod(string $method): static(getorpost) formnovalidate(bool $novalidate = true): staticformtarget(string $target): staticpopovertarget(string $elementId): static-
popovertargetaction(string $action): static(hide,show,toggle) render(): stringvalidate(): bool
- Default button type is
submit. - Caption text comes from inherited
caption(...). -
validate()always returnstrue. - Popover helpers generate
data-popovertargetanddata-popovertargetactionattributes.
Submit button with custom form endpoint:
$save = (new \Pair\Html\FormControls\Button('save'))
->caption('Save order')
->type('submit')
->formaction('/orders/save')
->formmethod('post')
->formenctype('multipart/form-data');
echo $save->render();Popover trigger button:
$help = (new \Pair\Html\FormControls\Button('help'))
->caption('Help')
->type('button')
->popovertarget('help-popover')
->popovertargetaction('toggle');See also: FormControl, Form, Toggle.
Home · Setup · Configuration
Build with Pair 4
- Generator
- Controllers and responses
- Read models
- ActiveRecord and queries
- Forms and validation
- PairUI.js and HTML fragments
APIs and authentication
- API guide and CRUD
- Middleware and rate limits
- Users, sessions, and ACL
- Passkeys and social login
- Native mobile setup
Integrate and operate
- Integrations
- Runtime extensions and adapter keys
- Cache and cache stores
- Logs and observability
- PWA and push
- Packages and distribution
- Upgrade to v4