Commit 428d9128 by Qiang Xue

script WIP

parent c1428a17
......@@ -87,7 +87,6 @@ class Application extends Module
*/
public $layout = 'main';
private $_runtimePath;
private $_ended = false;
/**
......@@ -224,6 +223,8 @@ class Application extends Module
return 0;
}
private $_runtimePath;
/**
* Returns the directory that stores runtime files.
* @return string the directory that stores runtime files. Defaults to 'protected/runtime'.
......@@ -251,6 +252,30 @@ class Application extends Module
}
}
private $_vendorPath;
/**
* Returns the directory that stores vendor files.
* @return string the directory that stores vendor files. Defaults to 'protected/vendor'.
*/
public function getVendorPath()
{
if ($this->_vendorPath !== null) {
$this->setVendorPath($this->getBasePath() . DIRECTORY_SEPARATOR . 'vendor');
}
return $this->_vendorPath;
}
/**
* Sets the directory that stores vendor files.
* @param string $path the directory that stores vendor files.
* @throws InvalidConfigException if the directory does not exist
*/
public function setVendorPath($path)
{
$this->_vendorPath = FileHelper::ensureDirectory($path);
}
/**
* Returns the time zone used by this application.
* This is a simple wrapper of PHP function date_default_timezone_get().
......
......@@ -7,6 +7,8 @@
namespace yii\base;
use Yii;
/**
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
......@@ -43,7 +45,6 @@ class ViewContent extends Component
* ~~~
*/
public $bundles;
public $title;
public $metaTags;
public $linkTags;
......@@ -68,9 +69,21 @@ class ViewContent extends Component
$this->jsFiles = null;
}
public function registerBundle($name)
public function renderScripts($pos)
{
}
public function registerBundle($name)
{
if (!isset($this->bundles[$name])) {
$am = Yii::$app->assets;
$bundle = $am->getBundle($name);
if ($bundle !== null) {
$this->bundles[$name] = $bundle;
} else {
throw new InvalidConfigException("Asset bundle does not exist: $name");
}
}
}
public function getMetaTag($key)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment