<div class="missao-content"> <img src="<?php echo Yii::app()->request->baseUrl . '/assets/web/img/Summerhall.jpg'; ?> " width="100" height="100"> <label>Missão em andamento!</label> <label id="btn"><a href="<?php echo Yii::app()->request->baseUrl . '/missao'; ?> "><button>Atualizar</button></a></label> </div> <?php } else { ?> <?php foreach (Missao::model()->findAll() as $missao) { ?> <div class="missao-content"> <img src="<?php echo Yii::app()->request->baseUrl . '/assets/web/img/Summerhall.jpg'; ?> " width="100" height="100"> <p>Nome: <?php echo $missao->nome_missao; ?> </p> <p>Descrição: <?php echo $missao->descricao_missao; ?> </p> <p>Recompensa em gold: 80</p>
/** * 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. * @param integer $id the ID of the model to be loaded * @return Missao the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Missao::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }