he

he

这家伙有点懒,还没写个性签名!

  • 财富值135
  • 威望值10
  • 总积分335

个人信息

  • 2014-09-29 已签到
    连续签到2天,获得了10个金钱
  • 2014-09-28 已签到
    连续签到1天,获得了5个金钱
  • $count = Yii::$app->db->createCommand('
        SELECT COUNT(*) FROM user WHERE status=:status
    ', [':status' => 1])->queryScalar();
    
    $dataProvider = new SqlDataProvider([
        'sql' => 'SELECT * FROM user WHERE status=:status',
        'params' => [':status' => 1],
        'totalCount' => $count,
        'sort' => [
            'attributes' => [
                'age',
                'name' => [
                    'asc' => ['first_name' => SORT_ASC, 'last_name' => SORT_ASC],
                    'desc' => ['first_name' => SORT_DESC, 'last_name' => SORT_DESC],
                    'default' => SORT_DESC,
                    'label' => 'Name',
                ],
            ],
        ],
        'pagination' => [
            'pageSize' => 20,
        ],
    ]);
    
    // get the user records in the current page
    $models = $dataProvider->getModels();
    
  • 为了避免你误人子弟我只好出手了

  • 视图

    // display pagination
    echo LinkPager::widget([
        'pagination' => $pages,
    ]);
    
  • $sql = $queryBuilder->batchInsert('user', ['name', 'age'], [
        ['Tom', 30],
        ['Jane', 20],
        ['Linda', 25],
    ]);
    
  • 这个批量插入只能叫多次插入

  • 回复了 的说说
    请问为什么我用gii生成的一个User模型。然后用模型里面自定义的一个属性$password2,为什么我的不能通过 $user_model-> attributes = $_POST['User'];获得$password2的值啊。
    unsafe
  • 不会,下次访问时刷新

    url: 'http://www.yiichina.com/follow?id=28519',
    dataType: 'json',
    success: function(data) {
    	if(data.action == 'create')
    	{
    	}
    	else
    	{
    		$.ajax({
    			url: 'http://www.yiichina.com/follow?id=28519',
        		});
    	}
        },
    

    });

  • Yii2.0还是这样注册么?不是控制器与视图分离了么?

    url: 'http://www.yiichina.com/follow?id=28519',
    dataType: 'json',
    success: function(data) {
    	if(data.action == 'create')
    	{
    	}
    	else
    	{
    		$.ajax({
    			url: 'http://www.yiichina.com/follow?id=28519',
        		});
    	}
        },
    

    });

见习主管 等级规则
335/500
资料完整度
30/100
用户活跃度
0/100

Ta的关注

23

Ta的粉丝

45

Ta的访客

30