飒雅
- 飒雅 回复了 zhoupenghui 的回答
在视图文件中:
``<?phpuse app\modules\member\components\ModuleAsset;
/ @var $this yii\web\View /
$assets = ModuleAsset::register($this);
$this->title = '';
$this->registerCssFile($assets->baseUrl . '/css/cart/index.css', ['depends' => [ModuleAsset::className()]]);
$this->registerJsFile($assets->baseUrl . '/js/cart/index.js', ['depends' => [ModuleAsset::className()]]);
?>`可以加载assets文件夹下的不同js和css
第一个好好的,第二个就开始乱串.
- 飒雅 2016-08-03 已签到连续签到2天,获得了10个金钱
- 飒雅 提出了问题Css and Js资源加载
- 飒雅 2016-08-02 已签到连续签到1天,获得了5个金钱
- 飒雅 回复了 zhoupenghui 的回答
$model = new User(); foreach($data as $attributes) { $_model = clone $model; $_model->setAttributes($attributes); $_model->save(); }
Yii::$app->db->createCommand()->batchInsert(UserModel::tableName(), ['user_id','username'], [ ['1','test1'], ['2','test2'], ['3','test3'], ])->execute();
@晦涩de咚 没有崩哦.顺利执行了.刷新一次就是40条.
- 飒雅 回复了 zhoupenghui 的回答
$model = new User(); foreach($data as $attributes) { $_model = clone $model; $_model->setAttributes($attributes); $_model->save(); }
Yii::$app->db->createCommand()->batchInsert(UserModel::tableName(), ['user_id','username'], [ ['1','test1'], ['2','test2'], ['3','test3'], ])->execute();
我想要一个随机码要怎么写呢?这个方法很强势.我试过了,可以滴
- 飒雅 回复了 zhoupenghui 的回答
$model = new User(); foreach($data as $attributes) { $_model = clone $model; $_model->setAttributes($attributes); $_model->save(); }
Yii::$app->db->createCommand()->batchInsert(UserModel::tableName(), ['user_id','username'], [ ['1','test1'], ['2','test2'], ['3','test3'], ])->execute();
我试试昂.