Можно как-то так:
// PhoneView
Pjax::begin(['enablePushState' => false, 'timeout' => 2000]);
if (isset($phone)){
echo Html::tag('b', 'Вот ваш телефон: '.$phone);
}
else {
echo Html::a('Показать телефон', ['/phone/show', 'id' => $model->id]);
}
Pjax::end();
// PhoneController
public function actionView($id){
if (null !== $model = Phones::find(['id' => $id])){
return $this->render('PhoneView', ['model' => $model]);
}
throw new NotFoundException();
}
public function actionShow($id){
if (null !== $model = Phones::find(['id' => $id])){
return $this->render('PhoneView', ['model' => $model, 'phone' => $model->phone]);
}
throw new InvalidParamException();
}