public function actionTrips($id) { if (!Yii::app()->user->isGuest) { if ($id == Yii::app()->user->id) { return $this->actionMyTrips(); } } $model = new Trip(); $model->retrieveScheduledTrips($id); $scheduledTrips = $model->getData(); $model->retrievePastTrips($id); $pastTrips = $model->getData(); $pastTripsPagination = $model->getPagination(); /** @var $user User */ $user = User::model()->findByPk($id); $messageForm = new MessageForm(); $messageForm->setReceiverId($user->id); $this->breadcrumbs = array('Головна' => $this->createUrl('site/index'), 'Туристичні знайомства' => $this->createUrl('index'), $user->getFirstName() => $this->createUrl('view', array('id' => $user->id)), 'Поїздки'); $this->render('trips', array('scheduledTrips' => $scheduledTrips, 'pastTrips' => $pastTrips, 'pastTripsPagination' => $pastTripsPagination, 'user' => $user, 'countOfPhotos' => Photos::getCountOfPhotos($user->id), 'messageForm' => $messageForm, 'sendMessageHandlerUrl' => $this->createUrl('SendMessageHandler'))); }