public function actionTrip($id) { /** @var $user User */ /** @var $mode Trip */ if (!($model = Trip::model()->findByPk($id))) { throw new CHttpException(404); } $user = User::model()->findByPk($model->owner_id); $this->breadcrumbs = array('Головна' => $this->createUrl('site/index'), 'Туристичні знайомства' => $this->createUrl('index'), $user->getFirstName() => $this->createUrl('view', array('id' => $user->id)), 'Поїздка'); $model->increaseViews(); $messageForm = new MessageForm(); $messageForm->setReceiverId($user->id); $this->render('trip', array('model' => $model, 'user' => $user, 'countOfPhotos' => Photos::getCountOfPhotos($user->id), 'messageForm' => $messageForm, 'sendMessageHandlerUrl' => $this->createUrl('SendMessageHandler'))); }