本文整理汇总了PHP中yii::setAlias方法的典型用法代码示例。如果您正苦于以下问题:PHP yii::setAlias方法的具体用法?PHP yii::setAlias怎么用?PHP yii::setAlias使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii
的用法示例。
在下文中一共展示了yii::setAlias方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testConfigureFromClass
public function testConfigureFromClass()
{
\yii::setAlias('@execut', '/');
$bundle = new AssetBundle();
$bundle->ignoreFileExists = true;
$bundle->configureFromClass();
$this->assertEquals('@execut/yii/web', $bundle->basePath);
$this->assertEquals('@execut/yii/web/assets', $bundle->sourcePath);
$this->assertEquals(['Bundle.js'], $bundle->js);
$this->assertEquals(['Bundle.css'], $bundle->css);
$bundle = new AssetBundle();
$bundle->js[] = 'test.js';
$bundle->configureFromClass();
$this->assertEquals(['test.js'], $bundle->js);
$this->assertEquals([], $bundle->css);
}
示例2:
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace vendor\codefire\cfusermgmt\assets;
use Yii;
use yii\web\AssetBundle;
use yii\helpers\Url;
yii::setAlias('@css_base', "@SITE_URL");
/**
* Debugger asset bundle
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class UsermgmtAsset extends AssetBundle
{
public $basePath = '@cfusermgmt/web/assets';
public $baseUrl = '@css_base/vendor/codefire/cfusermgmt/web';
public $css = ['css/jquery-ui.css', 'css/usermgmt.css', 'css/style.css', 'css/menu.css', 'css/font-awesome.min.css', 'css/ggl/Roboto_Condensed_400_400italic_700.css', 'css/ggl/Sans_Pro_400_200.css', 'css/ggl/Vollkorn_400_400italic_700_700italic.css'];
public $js = ['js/index.js', 'js/bootstrap.js', 'js/jquery-ui.js', 'js/usermgmt.js', 'js/bid.js'];
public $depends = ['yii\\web\\YiiAsset', 'yii\\bootstrap\\BootstrapAsset'];
}