cinghie / yii2-contacts
Yii2 Contacts
Installs: 551
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- cinghie/yii2-traits: @dev
- yiisoft/yii2: ^2.0.14
README
Yii2 Contacts to create, manage, and delete contacts in a Yii2 site.
Installation
The preferred way to install this extension is through composer.
Either run
$ php composer.phar require cinghie/yii2-contacts "*"
or add
"cinghie/yii2-contacts": "*"
Configuration
1. Update yii2-contacts database schema
Make sure that you have properly configured db
application component
and run the following command:
$ php yii migrate/up --migrationPath=@vendor/cinghie/yii2-contacts/migrations
With contacts table, will be installed also the country phonecode table
2. Set configuration file
Set on your configuration file
'modules' => [
// Yii2 Contacts
'contacts' => [
'class' => 'cinghie\contacts\Contacts'
],
]
Overrides
Override controller example, on modules config
'modules' => [
'contacts' => [
'class' => 'cinghie\contacts\Contacts',
'controllerMap' => [
'contacts' => 'app\controllers\ContactsController',
'phonecode' => 'app\controllers\PhonecodeController',
]
]
],
Override models example, on modules config
'modules' => [
'contacts' => [
'class' => 'cinghie\contacts\Contacts',
'modelMap' => [
'Contacts' => 'app\models\Contacts',
'Countriescodes' => 'app\models\Countriescodes',
]
]
],
Override view example, on components config
'components' => [
'view' => [
'theme' => [
'pathMap' => [
'@cinghie/contacts/views/contacts' => '@app/views/contacts/contacts',
],
],
],
],
Permissions
To access the module actions the user must have this permissions:
- Create: contacts-create-contacts
- Delete: contacts-delete-all-contacts or contacts-delete-his-contacts
- Index: contacts-index-contacts
- Update: contacts-update-all-contacts or contacts-update-his-contacts
- View: contacts-views-all-contacts or contacts-views-his-contacts
URLS
- Contacts: PathToApp/index.php?r=contacts/contacts/index
- Contacts with Pretty Urls: PathToApp/contacts/contacts/index