Questions tagged «yii2»

8
Yii2数据提供者默认排序
在Yii 1.1中,此代码适用于默认排序: $dataProvider = new CActiveDataProvider('article',array( 'sort'=>array( 'defaultOrder'=>'id DESC', ), )); 如何在Yii2中设置默认排序? 尝试以下代码,但没有结果: $dataProvider = new ActiveDataProvider([ 'query' => $query, 'sort' => ['defaultOrder'=>'topic_order asc'] ]);


7
Composer引发[ReflectionException]类Fxp \ Composer \ AssetPlugin \ Repository \ NpmRepository不存在
我安装了最新版本的(1.0.0。stable)composer,在我的Yii2项目中输入了以下内容: php composer.phar update 它给了我这个错误: [ReflectionException]类Fxp \ Composer \ AssetPlugin \ Repository \ NpmRepository不存在 [ErrorException] Fxp \ Composer \ AssetPlugin \ Repository \ AbstractAssetsRepository :: whatProvides()的声明应与Composer \ Repository \ ComposerRepository :: whatProvides(Composer \ DependencyResolver \ Pool $ pool,$ name,$ bypassFilters = false)兼容 有人可以帮我解决这个问题吗? 这是我的composer.json { "name": "yiisoft/yii2-app-advanced", "description": "Yii 2 …
80 php  yii2  composer-php 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.