首页 > 代码库 > yii小细节

yii小细节

1、main.php增加导航栏严格区分大小写,否则会出现404错误

2、增加‘分页’功能---前后台的models里面的search.php 添加

public function search($params)
    {
        $query = Study::find();

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            ‘query‘ => $query,
            ‘pagination‘ =>[‘pagesize‘=>3],
        ]);技术分享

 

yii小细节