|
|
|
@ -49,9 +49,13 @@ class ViewContent extends Component
|
|
|
|
|
public $metaTags; |
|
|
|
|
public $linkTags; |
|
|
|
|
public $css; |
|
|
|
|
public $js; |
|
|
|
|
public $cssFiles; |
|
|
|
|
public $js; |
|
|
|
|
public $jsFiles; |
|
|
|
|
public $jsInHead; |
|
|
|
|
public $jsFilesInHead; |
|
|
|
|
public $jsInBody; |
|
|
|
|
public $jsFilesInBody; |
|
|
|
|
|
|
|
|
|
public function populate($content) |
|
|
|
|
{ |
|
|
|
@ -64,86 +68,16 @@ class ViewContent extends Component
|
|
|
|
|
$this->metaTags = null; |
|
|
|
|
$this->linkTags = null; |
|
|
|
|
$this->css = null; |
|
|
|
|
$this->js = null; |
|
|
|
|
$this->cssFiles = null; |
|
|
|
|
$this->js = null; |
|
|
|
|
$this->jsFiles = null; |
|
|
|
|
$this->jsInHead = null; |
|
|
|
|
$this->jsFilesInHead = null; |
|
|
|
|
$this->jsInBody = null; |
|
|
|
|
$this->jsFilesInBody = null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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) |
|
|
|
|
{ |
|
|
|
|
return isset($this->metaTags[$key]) ? $this->metaTags[$key] : null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function setMetaTag($key, $tag) |
|
|
|
|
{ |
|
|
|
|
$this->metaTags[$key] = $tag; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getLinkTag($key) |
|
|
|
|
{ |
|
|
|
|
return isset($this->linkTags[$key]) ? $this->linkTags[$key] : null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function setLinkTag($key, $tag) |
|
|
|
|
{ |
|
|
|
|
$this->linkTags[$key] = $tag; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getCss($key) |
|
|
|
|
{ |
|
|
|
|
return isset($this->css[$key]) ? $this->css[$key]: null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function setCss($key, $css) |
|
|
|
|
{ |
|
|
|
|
$this->css[$key] = $css; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getCssFile($key) |
|
|
|
|
{ |
|
|
|
|
return isset($this->cssFiles[$key]) ? $this->cssFiles[$key]: null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function setCssFile($key, $file) |
|
|
|
|
{ |
|
|
|
|
$this->cssFiles[$key] = $file; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getJs($key, $position = self::POS_END) |
|
|
|
|
{ |
|
|
|
|
return isset($this->js[$position][$key]) ? $this->js[$position][$key] : null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function setJs($key, $js, $position = self::POS_END) |
|
|
|
|
{ |
|
|
|
|
$this->js[$position][$key] = $js; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getJsFile($key, $position = self::POS_END) |
|
|
|
|
{ |
|
|
|
|
return isset($this->jsFiles[$position][$key]) ? $this->jsFiles[$position][$key] : null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function setJsFile($key, $file, $position = self::POS_END) |
|
|
|
|
{ |
|
|
|
|
$this->jsFiles[$position][$key] = $file; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |