2017 © Pedro Peláez
 

symfony-bundle user-role-type-bundle

Generates a symfony form for user roles

image

coosos/user-role-type-bundle

Generates a symfony form for user roles

  • Wednesday, October 11, 2017
  • by Coosos
  • Repository
  • 1 Watchers
  • 1 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Coosos/UserRoleTypeBundle

SensioLabsInsight Build Status, (*1)

Requirements

Package Version
PHP ^7.1
Symfony ^3.4, ^4.0, ~5.0

Installation

Step 1 : Download the bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle :, (*2)

composer require "coosos/user-role-type-bundle" "^2.0"

This command is used if composer is installed in your system., (*3)

Step 2: Enable the Bundle

Then, enable the bundle by adding the following line in the app/AppKernel.php file of your project :, (*4)

// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Coosos\UserRoleTypeBundle\CoososUserRoleTypeBundle(),
        );
        // ...
    }
    // ...
}

Usage

Form type

use Coosos\UserRoleTypeBundle\Form\Type;
...
$builder->add("roles", UserRoleType::class, ["coosos_security_checked" => "strict"]);

Form twig

example, (*5)

{{ form_start(userForm) }}
{{ form_row(userForm.roles.ROLE_ADMIN) }}
{{ form_end(userForm) }}

Option

  • coosos_security_checked (default="strict")
    • strict = Prevents from being able to attribute a higher grade than his own
  • coosos_input_type (default="Symfony\Component\Form\Extension\Core\Type\CheckboxType")
    • Allows you to select another type of input (interesting for customize)

The Versions

11/10 2017

dev-master

9999999-dev

Generates a symfony form for user roles

  Sources   Download

LGPL-3.0

The Requires

 

by Remy Lescallier

form symfony role

11/10 2017

dev-dev

dev-dev

Generates a symfony form for user roles

  Sources   Download

LGPL-3.0

The Requires

 

by Remy Lescallier

form symfony role