PHP code example of kr-digital / sonata-user-bundle
1. Go to this page and download the library: Download kr-digital/sonata-user-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/ */
kr-digital / sonata-user-bundle example snippets
declare(strict_types=1);
namespace AppBundle\Admin;
use KR\SonataUserBundle\Form\Type\RolesMatrixType;
use KR\SonataUserBundle\Form\Type\SecurityRolesType;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Form\FormMapper;
// ...
class UserAdmin extends AbstractAdmin
{
protected $translationDomain = 'UserAdmin';
// ...
protected function configureFormFields(FormMapper $form)
{
$form
->add('roles', RolesMatrixType::class /** SecurityRolesType::class */, [
'expanded' => true,
'multiple' => true,
'