Download the PHP package mix8872/yii2-config without Composer
On this page you can find all versions of the php package mix8872/yii2-config. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-config
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require
section of your composer.json
.
Configuration
Edit components
section of your application config file.
Common:
Edit controllerMap
and modules
section of your application config file.
Backend:
If declared adminRole
then other user which haven't declared permissions can't create
Next run migration:
Usage
Now you can open url \config\ and manage you params
To get param value:
- Yii::$app->config->
- or Yii::$app->config->g('param_key')
To set param value from code:
- Yii::$app->config->
= - or Yii::$app->config->s(
, ) - or Yii::$app->config->s('
, ') - or Yii::$app->config->s([
, ]) - or Yii::$app->config->s([
=> ])
Events
Config module has next events:
- EVENT_AFTER_CREATE - fires on config option was added
- EVENT_AFTER_UPDATE - fires on config option was updated
- EVENT_AFTER_DELETE - fires on config option was deleted
- EVENT_BEFORE_SAVE - fires on each config option was saved
You can catch this events in config this way:
In $e->model
the event passes an object (or array of objects) of config items.
In EVENT_BEFORE_SAVE
event the model is passed by reference
and can be modified from event handler.
Access rules
You can define access rules for config options by define adminRole in config
or set rules inside config options. Access matrix you can find here.
All versions of yii2-config with dependencies
ext-mbstring Version *
ext-intl Version *
ext-json Version *
yiisoft/yii2-bootstrap5 Version 2.0.3
mihaildev/yii2-elfinder Version *
kartik-v/yii2-grid Version @dev
kartik-v/yii2-widget-select2 Version dev-master
kartik-v/yii2-widget-datetimepicker Version ^1.4
yiisoft/yii2-symfonymailer Version ~3.0.0
yiisoft/yii2-jui Version ~2.0