2017 © Pedro Peláez
 

yii2-extension yii2-common_2_170212

Experimental common Yii2 extensions for ASB-projects

image

asbsoft/yii2-common_2_170212

Experimental common Yii2 extensions for ASB-projects

  • Friday, July 27, 2018
  • by asbsoft
  • Repository
  • 1 Watchers
  • 0 Stars
  • 26 Installations
  • PHP
  • 9 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 33 Versions
  • 0 % Grown

The README.md

Common useful Yii2 extensions for united modules in ASB-projects

I like Yii2 framework, but I would like more tools for build independent, reusable and inheritable modules in this framework., (*1)

Here is some experimental extensions for my projects provided by "united modules"., (*2)

Yii2 has two applications template - basic and advanced. To satisfy both need more complicated configs which too many in Yii2. I will prepare examples of applications configs..., (*3)

Notes

  • Add to system all dependencies defined in "require" part of composer.json., (*4)

  • Use autoload.php here to register additional autoloads., (*5)

  • Register namespace \asb\yii2\common_2_170212 in system by composer or manually by define alias f.e. Yii::setAlias('@asb/yii2/common_2_170212', '@vendor/asbsoft/yii2-common_2_170212'); This definition you can place in index.php, most common config(s) or better way in @vendor/yiisoft/extensions.php to provide work in any of basic/frontend/backend/console application., (*6)

  • Make you own config files in config folder. Use *.EXAMPLES.php files as examples., (*7)

  • Run migrations., (*8)

  • To use additional functionality need to extends modules from \asb\yii2\common_2_170212\base\UniModule, controllers - from \asb\yii2\common_2_170212\controllers\BaseController and BaseAdminController, and active records models - from asb\yii2\common_2_170212\models\DataModel. Also add to application config in 'components' => [ //... 'view' => [ 'class' => 'asb\yii2\common_2_170212\web\UniView', ], // to work with views inherinance This operationd provide mechanism of modules inheritance: configs and messages will merged, views and actions will get from latest child., (*9)

  • Extension also has some functionality for switching multilanguage support provide by asb\yii2\common_2_170212\i18n\LangHelper and bootstraping by asb\yii2\common_2_170212\base\CommonBootstrap., (*10)

Using modules inheritance

  • Extends your ancestor module from base\UniModule. You can create another module with module class in root directory extends of ancestor module class. Than add this module as submodule to config of application or another module-container., (*11)

  • Now work such features:, (*12)

    • configs and params will merge with ancestors' data
    • messages will merge
    • for route(s) get latest file(s)
    • for view(s) get latest file(s) - possible to redefine only required file(s)
    • controllers and models - traditional inheritance
    • to use models inheritans you have to (re)define using models in config/config.php of module in format alias => class name or object array: 'models' => [..., 'ALIAS' => 'VENDOR\yii2\modules\MODULE_NAME\models\News', ...] for example 'News' => 'asb\yii2\modules\news_1\models\News', // in module-ancestor 'News' => 'asb\yii2\modules\news_2\models\News', // in module-child and for access to model you have to use everywhere (only for models in modules extends UniModule):
    • $module->getDataModel($alias, $params = [], $config = []) // get and init module object or same static method: ModuleClassName::model($alias, $params = [], $config = [])
    • to use assets inheritans you have to (re)define using assetss in config/config.php of module in format alias => class name: 'models' => [..., 'ALIAS' => 'CLASSNAME', ...] and in view use $assets = $this->context->module->registerAsset('MyAsset', $this); instead of $assets = MyAsset::register($this); and in new asset better use old asset as 'depends' not as a child - new CSS-files will include after and will redefine old styles

The Versions

27/07 2018

dev-master

9999999-dev

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

27/07 2018

2.14.7

2.14.7.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

25/07 2018

2.14.6

2.14.6.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

13/07 2018

2.14.5

2.14.5.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

15/04 2018

2.14.4

2.14.4.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

03/04 2018

2.14.3

2.14.3.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

01/04 2018

2.14.2

2.14.2.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

06/03 2018

2.14.1

2.14.1.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

04/03 2018

2.14

2.14.0.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

04/03 2018

2.13

2.13.0.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

19/02 2018

dev-doc

dev-doc

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

19/02 2018

2.11.3

2.11.3.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

19/02 2018

2.12

2.12.0.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

09/02 2018

2.11.2

2.11.2.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

06/02 2018

2.11.1

2.11.1.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

18/01 2018

2.11

2.11.0.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

03/01 2018

2.10.1

2.10.1.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

27/12 2017

2.10

2.10.0.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

05/12 2017

2.09

2.09.0.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

02/12 2017

2.08

2.08.0.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

02/12 2017

2.07.8

2.07.8.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

27/11 2017

2.07.7

2.07.7.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

24/11 2017

2.07.6

2.07.6.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

23/11 2017

2.07.5

2.07.5.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

21/11 2017

2.07.4

2.07.4.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

18/11 2017

2.07.3

2.07.3.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

17/11 2017

2.07.2

2.07.2.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

16/11 2017

2.07.1

2.07.1.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

15/11 2017

2.07

2.07.0.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

15/11 2017

2.06.1

2.06.1.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

30/10 2017

2.06

2.06.0.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

20/10 2017

2.05

2.05.0.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2

09/04 2017

2.04

2.04.0.0

Experimental common Yii2 extensions for ASB-projects

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexandr Belogolovsky

extensions yii2