PHP code example of enjoys / bootstrap4-renderer

1. Go to this page and download the library: Download enjoys/bootstrap4-renderer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

enjoys / bootstrap4-renderer example snippets


use Enjoys\Forms\Renderer\Bootstrap4\Bootstrap4Renderer;
use Enjoys\Forms\Form;
$renderer = new Bootstrap4Renderer();
/** @var Form $form */
$renderer->setForm($form);
$renderer->output();

use Enjoys\Forms\Renderer\Bootstrap4\Bootstrap4Renderer;
use Enjoys\Forms\Form;
/** @var Form $form */
$renderer = new Bootstrap4Renderer($form);
$renderer->output();

$renderer->setOptions([
    'switch' => true 
]);

$renderer->setOptions([
    'switch' => 'element_name'
]);

$renderer->setOptions([
    'switch' => [
        'element_name', 
        'more_element', 
        //...
    ] 
]);