コード例 #1
0
} else {
    echo $form->dropDownList($model, 'cat_id', array('prompt' => Yii::t('phrase', 'Select One')));
}
?>
				<?php 
echo $form->error($model, 'cat_id');
?>
				<?php 
/*<div class="small-px silent"></div>*/
?>
			</div>
		</div>

		<?php 
$parent = null;
$menu = OmmuMenu::getParentMenu(null, $parent);
if ($menu != null) {
    ?>
		<div class="clearfix">
			<?php 
    echo $form->labelEx($model, 'dependency');
    ?>
			<div class="desc">
				<?php 
    echo $form->dropDownList($model, 'dependency', $menu, array('prompt' => Yii::t('phrase', 'No Parent')));
    ?>
				<?php 
    echo $form->error($model, 'dependency');
    ?>
				<?php 
    /*<div class="small-px silent"></div>*/
コード例 #2
0
 /**
  * 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 the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = OmmuMenu::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, Yii::t('phrase', 'The requested page does not exist.'));
     }
     return $model;
 }