Beispiel #1
0
                <span><a href="<?php 
echo Yii::$app->urlManager->createUrl(['act/hometown/index']);
?>
">活动详情</a></span>
            </li>
            <li class="nav_list <?php 
if (Yii::$app->controller->action->id == 'works') {
    echo 'nav_active';
}
?>
">
                <span><a href="<?php 
echo Yii::$app->urlManager->createUrl(['act/hometown/works']);
?>
">参与作品(<?php 
echo ActHometown::find()->where(['status' => 1])->count();
?>
)</a></span>
            </li>
            <li class="nav_list <?php 
if (Yii::$app->controller->action->id == 'top') {
    echo 'nav_active';
}
?>
">
                <span><a href="<?php 
echo Yii::$app->urlManager->createUrl(['act/hometown/top']);
?>
">排行榜</a></span>
            </li>
        </ul>
 /**
  * Finds the JobLevel model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return JobLevel the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = ActHometown::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }