PHP code example of rarog / user-rbac
1. Go to this page and download the library: Download rarog/user-rbac 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/ */
rarog / user-rbac example snippets
public function onBootstrap(EventInterface $e)
{
$app = $e->getApplication();
$sm = $app->getServiceManager();
$em = $app->getEventManager();
$listener = $sm->get(\UserRbac\View\Strategy\SmartRedirectStrategy::class);
$listener->attach($em);
}