Beispiel #1
0
 /**
  * Finds the NavUrl model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return NavUrl the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = NavUrl::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Beispiel #2
0
foreach ($nav as $key => $item) {
    ?>
    <div class="panel panel-default corner-radius" id="<?php 
    echo $item->alias;
    ?>
">
        <div class="panel-heading text-left">
            <h3 class="panel-title"><?php 
    echo $item->name;
    ?>
</h3>
        </div>
        <div class="panel-body text-left">
            <div class="row">
                <?php 
    $NavUrl = NavUrl::find()->where(['nav_id' => $item->id])->orderBy('order asc')->all();
    ?>
                <?php 
    if ($NavUrl) {
        ?>
                    <?php 
        foreach ($NavUrl as $sub_key => $sub_item) {
            ?>
                        <div class="col-md-2 nav-item"><a href="<?php 
            echo $sub_item->url;
            ?>
" target="_blank" data-toggle="tooltip" data-placement="top"
                                                  title="<?php 
            echo $sub_item->description;
            ?>
"><?php