2017 © Pedro Peláez
 

yii2-extension yii2-application

image

yongtiger/yii2-application

  • Wednesday, March 15, 2017
  • by yongtiger
  • Repository
  • 1 Watchers
  • 1 Stars
  • 10 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Yii2-application releas version 1.1.0 (#ADD backend:isAdminEnd)

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

FEATURES

  • beforeInit() and afterInit() in application
  • remote appplication callback, e.g. calling frontend cache flushing from backend

DEPENDENCES

INSTALLATION

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist yongtiger/yii2-application "*"

or add, (*4)

"yongtiger/yii2-application": "*"

to the require section of your composer.json., (*5)

CONFIGURATION

  • \common\config\params.php
'yongtiger.application.remoteAppConfigs' => [
    'app-backend' => [
        'class' => 'backend\\components\\Application',  ///optional
        '@common/config/main.php',
        '@common/config/main-local.php',
        '@backend/config/main.php',
        '@backend/config/main-local.php',
    ],
    'app-frontend' => [
        'class' => 'frontend\\components\\Application', ///optional
        '@common/config/main.php',
        '@common/config/main-local.php',
        '@frontend/config/main.php',
        '@frontend/config/main-local.php',
    ],
],

USAGE

  • beforeInit() and afterInit()
class Application extends \yongtiger\application\Application 
{
    /**
     * @inheritdoc
     */
    public function beforeInit() {

        parent::beforeInit();

        ///[v0.10.5 (filter theme bootstrap)]
        ///You can still run without yii2 extension `yongtiger/yii-theme`.
        ///Note: Cannot use `class_exists('yongtiger\\theme\\Bootstrap')` before application init!
        if (is_file($this->getVendorPath() . DIRECTORY_SEPARATOR . 'yongtiger'. DIRECTORY_SEPARATOR . 'yii2-theme' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Bootstrap.php')) {

            \yongtiger\theme\Bootstrap::filterExtensionsBootstrap();

        }

    }

    /**
     * @inheritdoc
     */
    public function afterInit() {

        parent::afterInit();

    }
}
  • remote appplication callback
Application::remoteAppCall('app-frontend', function($app) {
    $app->cache->flush();
}, function ($config) {
    unset($config['bootstrap']);    ///[yii2-brainbase v0.3.0 (admin:rbac):fix Yii debug disappear in route]
    return $config;
});

NOTES

DOCUMENTS

SEE ALSO

TODO

Development roadmap

LICENSE

Yii2-application is released under the MIT license, see LICENSE file for details., (*6)

The Versions

15/03 2017

dev-master

9999999-dev http://www.branbook.cc

  Sources   Download

MIT

The Requires

 

extension yii2 application

15/03 2017

1.1.0

1.1.0.0 http://www.branbook.cc

  Sources   Download

MIT

The Requires

 

extension yii2 application

12/03 2017

1.0.1

1.0.1.0 http://www.branbook.cc

  Sources   Download

MIT

The Requires

 

extension yii2 application

11/03 2017

1.0.0

1.0.0.0 http://www.branbook.cc

  Sources   Download

MIT

The Requires

 

extension yii2 application

10/03 2017

v0.0.0

0.0.0.0 http://www.branbook.cc

  Sources   Download

MIT

The Requires

 

extension yii2 application