hebo5485
- hebo5485 2016-06-22 已签到连续签到3天,获得了15个金钱
- hebo5485 2016-06-21 已签到连续签到2天,获得了10个金钱
- hebo5485 2016-06-20 已签到连续签到1天,获得了5个金钱
- hebo5485 2016-06-17 已签到连续签到6天,获得了20个金钱
- hebo5485 回复了话题 在视图中引入js的问题
谢谢两位解答,然而还是报错:
PHP Warning – yii\base\ErrorException Cannot use a scalar value as an array 1. in E:\www\yii2test\vendor\yiisoft\yii2\helpers\BaseHtml.php at line 261 * * The rest of the options will be rendered as the attributes of the resulting script tag. The values will * be HTML-encoded using [[encode()]]. If a value is null, the corresponding attribute will not be rendered. * See [[renderTagAttributes()]] for details on how attributes are being rendered. * @return string the generated script tag * @see Url::to() */ public static function jsFile($url, $options = []) { $options['src'] = Url::to($url); if (isset($options['condition'])) { $condition = $options['condition']; unset($options['condition']); return self::wrapIntoCondition(static::tag('script', '', $options), $condition); } else { return static::tag('script', '', $options); } }
- hebo5485 2016-06-16 已签到连续签到5天,获得了20个金钱
- hebo5485 发布了话题在视图中引入js的问题
- hebo5485 赞了评论
使用Url::to()也是可以的。方法如下:
<?php use yii\helpers\Url; ...... Url::to(['site/index']);
- hebo5485 2016-06-15 已签到连续签到4天,获得了20个金钱
- hebo5485 2016-06-14 已签到连续签到3天,获得了15个金钱