mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 05:48:11 +08:00
script WIP
This commit is contained in:
@ -56,6 +56,11 @@ class Application extends Module
|
||||
* If this is false, layout will be disabled.
|
||||
*/
|
||||
public $layout = 'main';
|
||||
/**
|
||||
* @var array list of installed extensions. The array keys are the extension names, and the array
|
||||
* values are the corresponding extension root source directories or path aliases.
|
||||
*/
|
||||
public $extensions = array();
|
||||
|
||||
private $_ended = false;
|
||||
|
||||
@ -81,12 +86,19 @@ class Application extends Module
|
||||
|
||||
if (isset($config['basePath'])) {
|
||||
$this->setBasePath($config['basePath']);
|
||||
Yii::setAlias('@app', $this->getBasePath());
|
||||
unset($config['basePath']);
|
||||
Yii::$aliases['@app'] = $this->getBasePath();
|
||||
} else {
|
||||
throw new InvalidConfigException('The "basePath" configuration is required.');
|
||||
}
|
||||
|
||||
if (isset($config['extensions'])) {
|
||||
foreach ($config['extensions'] as $name => $path) {
|
||||
Yii::setAlias("@$name", $path);
|
||||
}
|
||||
unset($config['extensions']);
|
||||
}
|
||||
|
||||
$this->registerErrorHandlers();
|
||||
$this->registerCoreComponents();
|
||||
|
||||
@ -206,7 +218,7 @@ class Application extends Module
|
||||
*/
|
||||
public function getVendorPath()
|
||||
{
|
||||
if ($this->_vendorPath !== null) {
|
||||
if ($this->_vendorPath === null) {
|
||||
$this->setVendorPath($this->getBasePath() . DIRECTORY_SEPARATOR . 'vendor');
|
||||
}
|
||||
return $this->_vendorPath;
|
||||
|
||||
@ -28,6 +28,7 @@ class ViewContent extends Component
|
||||
* @var \yii\web\AssetManager
|
||||
*/
|
||||
public $assetManager;
|
||||
|
||||
public $assetBundles;
|
||||
public $title;
|
||||
public $metaTags;
|
||||
@ -45,7 +46,7 @@ class ViewContent extends Component
|
||||
{
|
||||
parent::init();
|
||||
if ($this->assetManager === null) {
|
||||
$this->assetManager = Yii::$app->getAssetManager();
|
||||
$this->assetManager = Yii::$app->getAssets();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user