PHP code example of yongtiger / yii2-application
1. Go to this page and download the library: Download yongtiger/yii2-application library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
yongtiger / yii2-application example snippets
'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',
],
],
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();
}
}
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;
});
php composer.phar