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

0.9.7 2019-07-11 10:57 UTC

This package is auto-updated.

Last update: 2024-11-10 11:29:48 UTC


README

License Latest Stable Version Latest Release Date Latest Commit Total Downloads

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