AssetManager
4. März 2011
private $_assetsUrl; /** * protected/modules/admin/assets/images/logo.png befindet sich in deny from all * und wird nach webroot/assets/blablub/images/logo.png verfrachtet * @see http://www.yiiframework.com/doc/api/1.1/CAssetManager#publish-detail */ public function getAssetsUrl() { if ($this->_assetsUrl === null) { $this->_assetsUrl = Yii::app()->getAssetManager()->publish( Yii::getPathOfAlias('admin.assets'), false, -1, YII_DEBUG ); } return $this->_assetsUrl; }
Zugriff dann im View wie folgt:
<?php echo CHtml::image($this->module->assetsUrl . '/images/logo.png'); ?>
Verwandte Artikel:
Letzte Kommentare