/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. */ public function loadModel() { if ($this->_model === null) { if (isset($_GET['id'])) { $this->_model = ClassSession::model()->findbyPk($_GET['id']); } if ($this->_model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } } return $this->_model; }
public function actionClassDashboard() { $s = ClassSession::model()->findByPk(ClassSession::savedSessionId()); $this->render('class_dashboard', array('classes' => $s->active_classes, 'cancelled' => $s->cancelled_classes)); }
public function actionDescriptions() { $cs = ClassSession::model()->findByPk(ClassSession::savedSessionId()); $this->render('descriptions', array('classes' => $cs->active_classes)); }
<?php $this->pageTitle = Yii::app()->name; $this->breadcrumbs = array(); // reset ?> <h1>After-School Enrichment Program – <?php echo CHtml::encode($this->savedSessionSummary()); ?> </h1> <?php // XXX this is stupid, move this to a controller, // deal with the whole persomnalized home page thing better $cs = ClassSession::model()->findByPk(ClassSession::savedSessionId()); $this->renderPartial('/admin/signupsheet', array('classes' => $cs->active_classes));