public function actionEdit($id = null, $rubric = 1) { if (null === $id || 'new' == $id) { $this->data->item = new Page(); } else { $this->data->item = Page::findByPk($id); $this->data->photos = Photo::findAllBy__page_id($id); } $this->data->rubric = Rubric::findByPk($rubric); //$this->data->photos=Photo::findAllByColumn__page_id() }