1. Go to this page and download the library: Download geniv/nette-identity-acl 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/ */
geniv / nette-identity-acl example snippets
protected function createComponentRoleForm(RoleForm $roleForm): RoleForm
{
//$roleForm->setTemplatePath(path);
//$roleForm->onSuccess[] = function (Form $form, array $values) { };
//$roleForm->onError[] = function (Form $form) { };
return $roleForm;
}
protected function createComponentResourceForm(ResourceForm $resourceForm): ResourceForm
{
//$resourceForm->setTemplatePath(path);
//$resourceForm->onSuccess[] = function (Form $form, array $values) { };
//$resourceForm->onError[] = function (Form $form) { };
return $resourceForm;
}
protected function createComponentPrivilegeForm(PrivilegeForm $privilegeForm): PrivilegeForm
{
//$privilegeForm->setTemplatePath(path);
//$privilegeForm->onSuccess[] = function (Form $form, array $values) { };
//$privilegeForm->onError[] = function (Form $form) { };
return $privilegeForm;
}
protected function createComponentAclForm(AclForm $aclForm, AclFormContainer $aclFormContainer, IIdentityAuthorizator $identityAuthorizator): AclForm
{
//$aclFormContainer->onRender = function ($data) { return $data; };
//$aclFormContainer->setMultiSelect(true);
// $this['aclForm']['form']->setDefaults($this['aclForm']->getDefaults($id));
// $this['aclForm']['form']->setDefaults($identityAuthorizator->getAclForm($id));
//$aclForm->setTemplatePath(path);
//$aclForm->onSuccess[] = function (Form $form, array $values) use ($aclForm) { $aclForm->saveAcl(array $values) };
//$aclForm->onError[] = function (Form $form) { };
return $aclForm;
}