enjoys / bootstrap4-renderer
Renderer for enjoys/forms
Installs: 1 287
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.0
- enjoys/forms: ^5.9
Requires (Dev)
- httpsoft/http-server-request: ^1.1
- infection/infection: ^0.26
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.6
README
Renderer for enjoys/forms
Run built-in server for view example
port=$(shuf -i 2048-65000 -n 1); php -S localhost:"${port}" -t ./example .route
Usage
use Enjoys\Forms\Renderer\Bootstrap4\Bootstrap4Renderer; use Enjoys\Forms\Form; $renderer = new Bootstrap4Renderer(); /** @var Form $form */ $renderer->setForm($form); $renderer->output();
or
use Enjoys\Forms\Renderer\Bootstrap4\Bootstrap4Renderer; use Enjoys\Forms\Form; /** @var Form $form */ $renderer = new Bootstrap4Renderer($form); $renderer->output();
Options
switch
setting for the checkbox elements the custom switch control
see https://getbootstrap.com/docs/4.6/components/forms/#switches
setting for all the checkbox elements the custom switch
$renderer->setOptions([ 'switch' => true ]);
setting for one element the custom switch
$renderer->setOptions([ 'switch' => 'element_name' ]);
setting a custom switch for the listed elements
$renderer->setOptions([ 'switch' => [ 'element_name', 'more_element', //... ] ]);