Questions About Model::fields And Model::extrafields

  1. Is it possible to dynamically manage fields, extraFields. I mean set these params after record was found (or before).

  2. Is it possible to specify nested relations in extraFields like:

    public function extraFields()


     $fields = parent::extraFields();
     return $fields;


Or only one relation-level is supporting?

  1. Sure, just override this function by your own, something like

private $fields = ['id', 'name'];

public function fields() 


    return $this->fields;


public function setFields($fields)


    $this->fields = $fields;


  1. Haven’t tried yet, so dot-notation is not working?
  1. ok, good idea.

  2. Not working

 "Getting unknown property: common\models\"