\Yii::$app->runAction("controllerId/actionId")
Или людой нужный вам route используете. public function getProfile() {
return $this->hasOne(Profile::class,['id'=>'id']);
}
$user = User::find()->andWhere(['username'=>$login])->one();
$user->name; // своятво пользователя
$user->profile->id // свойство профиля
$user = User::find()->with('profile')->andWhere(['username'=>$login])->one();
$data = Content::find()->getAuthor()->all();
$data = Content::find()->one()
->getAuthor()->one();
$data = Content::find()
->with('author')
->all();
class Test extends ActiveRecord
{
...
public function getTags()
{
return $this->hasMany(Tag::class, ['text_id' => 'id']);
}
}
public function actionIndex()
{
return Text::find()
->andWhere(/* ... */)
->with('tags')
->all();
}