PHP code example of lyssal / admin-bundle

1. Go to this page and download the library: Download lyssal/admin-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/ */

    

lyssal / admin-bundle example snippets


new Lyssal\AdminBundle\LyssalAdminBundle(),

new Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(),
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
new FOS\UserBundle\FOSUserBundle(),
new Sonata\CoreBundle\SonataCoreBundle(),
new Sonata\BlockBundle\SonataBlockBundle(),
new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
new Sonata\AdminBundle\SonataAdminBundle(),
new Ivory\CKEditorBundle\IvoryCKEditorBundle(),

new Doctrine\Bundle\PHPCRBundle\DoctrinePHPCRBundle(),
new Sonata\DoctrinePHPCRAdminBundle\SonataDoctrinePHPCRAdminBundle(),
new Symfony\Cmf\Bundle\CoreBundle\CmfCoreBundle(),
new Symfony\Cmf\Bundle\ContentBundle\CmfContentBundle(),
new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
new Symfony\Cmf\Bundle\SimpleCmsBundle\CmfSimpleCmsBundle(),
new Symfony\Cmf\Bundle\TreeBrowserBundle\CmfTreeBrowserBundle(),
new Lyssal\SymfonyCmf\SimpleCmsBundle\LyssalSymfonyCmfSimpleCmsBundle(),
sh
php composer.phar update
yml
security:
    encoders:
        FOS\UserBundle\Model\UserInterface: sha512

    role_hierarchy:
        ROLE_ADMIN:       [ROLE_USER, ROLE_SONATA_ADMIN]
        ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
        SONATA:
            - ROLE_SONATA_PAGE_ADMIN_PAGE_EDIT

    providers:
        fos_userbundle:
            id: fos_user.user_manager

    firewalls:
        dev:
            pattern:  ^/(_(profiler|wdt|error)|css|images|js)/
            security: false


        #<-- Console administrative
        admin:
            pattern: /console/(.*)
            context: user
            form_login:
                provider: fos_userbundle
                login_path: /console/login
                use_forward: false
                check_path: /console/login_check
                failure_path: null
            logout:
                path: /console/logout
            anonymous: true
        #-->
        #<-- Front
        main:
            pattern: .*
            context: user
            form_login:
                provider: fos_userbundle
                login_path: fos_user_security_login
                use_forward: false
                check_path: fos_user_security_check
                failure_path: null
            logout:
                path: /deconnexion
            anonymous: true
            switch_user: true
        #-->

    access_control:
        #<-- Connexion utilisateur (FOSUserBundle)
        - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/console/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/console/logout$, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/console/login_check$, role: IS_AUTHENTICATED_ANONYMOUSLY }
        #-->
        
        - { path: ^/efconnect, role: ROLE_USER }
        - { path: ^/elfinder, role: ROLE_USER }

        - { path: ^/console/, role: [ROLE_ADMIN, ROLE_SONATA_ADMIN] }
        - { path: ^/.*, role: IS_AUTHENTICATED_ANONYMOUSLY }