Yii2 Rest I can not send the Name field of another Table

1

How do I send the Employee name that is in the Officers table to appear in the request of a REST ?

I'm newbie, it appears in the view I tested, but I do not think the correct way to send it by REST .

the Asos table has the id and the Employee table has the function id And it does not have FK because it is myIsam .

MODEL

public function getFuncionarios()
{
   return $this->hasMany(Funcionarios::className(),['idFuncionario'=>'idFuncionario']);
}

CONTROLLER

class DefaultController extends ActiveController
{
   public $modelClass = 'app\models\Asos';
}

model - > Bitbucket

Controller - > Bitbucket

    
asked by anonymous 18.09.2017 / 16:34

0 answers