示例#1
0
 /**
  * @return bool Returns true if message board is underconstruction . else returns false.
  */
 public static function isUnderConstruction()
 {
     /*@var $model MessageBoard*/
     $model = MessageBoard::model()->find();
     return $model->messageType == "warning" ? true : false;
 }
    </div>
</div>

<div class="subnav navbar navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container">
            <?php 
if (false) {
    ?>
            <?php 
    //if (  MessageBoard::isUnderConstruction()   ):
    ?>
                <h3 style="color: red;">
                    <i class="fa fa-asterisk"></i>
                    <?php 
    echo MessageBoard::model()->find()->messageStatus;
    ?>
                    <small>
                        <?php 
    echo MessageBoard::model()->find()->fullMessage;
    ?>
                    </small>
                </h3>
            <?php 
}
?>

        </div><!-- container -->
    </div><!-- navbar-inner -->
</div><!-- subnav -->
 /**
  * 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 MessageBoard the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = MessageBoard::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }