PHP code example of nowo-tech / select-all-choice-bundle

1. Go to this page and download the library: Download nowo-tech/select-all-choice-bundle 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/ */

    

nowo-tech / select-all-choice-bundle example snippets




return [
  // ...
  Nowo\SelectAllChoiceBundle\NowoSelectAllChoiceBundle::class => ['all' => true],
];

use Symfony\Component\Form\Extension\Core\Type\ChoiceType;

$builder->add('roles', ChoiceType::class, [
  'choices' => [
    'Admin' => 'ROLE_ADMIN',
    'User' => 'ROLE_USER',
    'Guest' => 'ROLE_GUEST',
  ],
  'multiple' => true,
  'expanded' => true,
  'select_all' => true,
]);