-
Notifications
You must be signed in to change notification settings - Fork 6
EavModule Installation Guide
The eavactiverecord extension should be installed, as described here, before using EavModule.
The process of installing the module is typically quite simple and similar to installing other Yii modules. Follow the instructions below:
-
Create the directory "protected/modules" and move the directory "eav" ("protected/components/eavactiverecord/modules/eav") there.
-
Add the following lines in the file "protected/config/main.php":
'modules' => array('eav')
-
Create the directory "assets" in the webroot directory. The assets directory is used to hold asset files like .css, .js, etc.
Now you can access the module pages.
The EAV attributes management page: http:://yourdomain.com/eav/attribute/
The EAV attribute sets management page: http:://yourdomain.com/eav/set/
By default anyone can access the module.
You need to set up access control filter or role-based access, to give permissions for only necessary users to perform the controller action inside the module.
To set up access control filter, please follow the example below :
protected/confing/main.php
'modules' => array(
'eav' => array(
'filters' => array('set' => array('accessControl'),
'attribute' => array('accessControl')
),
'accessRules' => array(
'set' => array(
array('allow',
'actions' => array('index', 'create', 'update', 'delete'),
'users' => array('@')
),
array('deny')
),
'attribute' => array(
array('allow',
'actions' => array('index', 'create', 'update', 'delete'),
'users' => array('@')
),
array('deny')
),
),
))
To set up role-based access you can use the following code:
'modules' => array(
'eav' => array(
'filters' => array('set' => array('accessControl'),
'attribute' => array('accessControl')
),
'accessRules' => array(
'set' => array(
array('allow',
'actions' => array('index'),
'roles' => array('readEavSet')
),
array('allow',
'actions' => array('create'),
'roles' => array('createEavSet')
),
array('allow',
'actions' => array('update'),
'roles' => array('updateEavSet')
),
array('allow',
'actions' => array('delete'),
'roles' => array('deleteEavSet')
),
array('deny')
),
'attribute' => array(
array('allow',
'actions' => array('index'),
'roles' => array('readEavAttribute')
),
array('allow',
'actions' => array('create'),
'roles' => array('createEavAttribute')
),
array('allow',
'actions' => array('update'),
'roles' => array('updateEavAttribute')
),
array('allow',
'actions' => array('delete'),
'roles' => array('deleteEavAttribute')
),
array('deny')
),
),
))
Keep in mind that there are just examples, so you can add your own access rules as needed.
Also you can change the number of items displayed per page (the default value is set to 50):
'modules' => array('eav' => array('itemsPerPage' => 20)),
#####Screenshots of the module
The EAV attributes management page
The EAV attribute sets management page 
The Eav attribute edit page 
The Eav attribute set edit page 