如何在yii2中获取var_dump()的值?

时间:2017-07-22 18:11:33

标签: yii2

var_dump($dataProvider);

抛出以下输出:

 .
 .
 .
 19 => 
        object(app\models\Bewerbungen)[219]
          private '_attributes' (yii\db\BaseActiveRecord) => 
            array (size=12)
              ...
          private '_oldAttributes' (yii\db\BaseActiveRecord) => 
            array (size=12)
              ...
          private '_related' (yii\db\BaseActiveRecord) => 
            array (size=2)
              ...
          private '_errors' (yii\base\Model) => null
          private '_validators' (yii\base\Model) => null
          private '_scenario' (yii\base\Model) => string 'default' (length=7)
          private '_events' (yii\base\Component) => 
            array (size=0)
              ...
          private '_behaviors' (yii\base\Component) => 
            array (size=0)
              ...
  private '_totalCount' (yii\data\BaseDataProvider) => int 44
  private '_events' (yii\base\Component) => 
    array (size=0)
      empty
  private '_behaviors' (yii\base\Component) => null

我只需要跟随var_dump()的值:

private '_totalCount' (yii\data\BaseDataProvider) =>int 44

任何想法如何挑选$ dataProvider的这个值。我尝试了几个foreach() - 循环,但我没有成功

1 个答案:

答案 0 :(得分:4)