當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CMenu類代碼示例

本文整理匯總了PHP中CMenu的典型用法代碼示例。如果您正苦於以下問題:PHP CMenu類的具體用法?PHP CMenu怎麽用?PHP CMenu使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CMenu類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init

 /**
  *
  */
 public function init()
 {
     if ($this->cssFile === null) {
         $file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'responsiveCMenu.css';
         $this->cssFile = Yii::app()->getAssetManager()->publish($file);
     }
     Yii::app()->clientScript->registerCssFile($this->cssFile);
     parent::init();
 }
開發者ID:ChristopheBrun,項目名稱:hLib,代碼行數:12,代碼來源:ResponsiveCMenu.php

示例2: init

 public function init()
 {
     parent::init();
     $this->activateParents = true;
     $this->htmlOptions = array('class' => 'nav nav-list');
     $this->submenuHtmlOptions = array('class' => 'nav nav-list');
 }
開發者ID:kumarsivarajan,項目名稱:yii-user-management,代碼行數:7,代碼來源:YumMenu.php

示例3: init

 public function init()
 {
     if (!empty($this->class)) {
         $this->htmlOptions['class'] = $this->class;
     }
     parent::init();
 }
開發者ID:nickgr6,項目名稱:Datepicker,代碼行數:7,代碼來源:DMenu.php

示例4: init

 public function init()
 {
     $assets = Yii::app()->assetManager->publish(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets', false, -1, true);
     $cs = Yii::app()->getClientScript();
     $cs->registerCssFile($assets . '/emenu.css');
     parent::init();
 }
開發者ID:BGCX261,項目名稱:zoomtyre-svn-to-git,代碼行數:7,代碼來源:EMenu.php

示例5: init

 public function init()
 {
     parent::init();
     $cs = Yii::app()->clientScript;
     $cs->registerScriptFile(Yii::app()->theme->baseUrl . '/js/bootstrap.js', CClientScript::POS_END);
     Yii::app()->clientScript->registerCoreScript('jquery');
 }
開發者ID:rzamarripa,項目名稱:masoftproyectos,代碼行數:7,代碼來源:BMenu.php

示例6: renderMenuItem

 protected function renderMenuItem($item)
 {
     if (isset($item['icon'])) {
         $item['label'] .= Theme::img('icons/' . $item['icon'] . '.png');
     }
     return parent::renderMenuItem($item);
 }
開發者ID:Jmainguy,項目名稱:multicraft_install,代碼行數:7,代碼來源:Menu.php

示例7: init

 public function init()
 {
     // Here we define query conditions.
     $criteria = new CDbCriteria();
     $criteria->limit = 2;
     $criteria->condition = '`status` = 1';
     //$criteria->order = '`position` ASC';
     $items = CmsPages::model()->findAll($criteria);
     //echo "items"."<pre>";print_r($items);die;
     foreach ($items as $item) {
         $this->items[] = array('label' => $item->title, 'url' => Yii::app()->createUrl("user/pages", array('id' => $item->id)));
     }
     // footer
     /* $criteria1 = new CDbCriteria;
             
             $criteria1->condition = '`status` = 1';
             //$criteria->order = '`position` ASC';
     
             $footeritems = CmsPages::model()->findAll($criteria1);
             //echo "items"."<pre>";print_r($footeritems);die;
             foreach ($footeritems as $footer)
                 $this->items[] = array('label'=>$footer->title, 'url'=>Yii::app()->createUrl("user/pages",array('id'=>$footer->id)));
              */
     parent::init();
 }
開發者ID:KaranSofat,項目名稱:yii,代碼行數:25,代碼來源:ActiveMenu.php

示例8: init

 function init()
 {
     parent::init();
     if (!empty($this->htmlOptions['class'])) {
         $this->htmlOptions['class'] .= ' iconized';
     } else {
         $this->htmlOptions['class'] = 'iconized';
     }
     Yii::app()->clientScript->registerCssFile(Yii::app()->assetManager->publish(dirname(__FILE__) . '/assets/iconizedMenu.css'));
     if ($this->useSprites) {
         $domains = array();
         foreach ($this->items as $item) {
             $components = parse_url($item['url']);
             $domains[] = $components['host'];
         }
         $spriteUrl = $this->yandexBaseUrl . implode('/', $domains);
         $offset = 0;
         foreach ($this->items as &$item) {
             $item['linkOptions']['style'] = "background-image: url({$spriteUrl}); background-position: 0 {$offset}px";
             $offset -= 16;
         }
     } else {
         foreach ($this->items as &$item) {
             $components = parse_url($item['url']);
             $iconUrl = $this->iconizerBaseUrl . $components['host'];
             $item['linkOptions']['style'] = "background-image: url({$iconUrl})";
         }
     }
 }
開發者ID:sinelnikof,項目名稱:yiiext,代碼行數:29,代碼來源:EIconizedMenu.php

示例9: init

 public function init()
 {
     $this->htmlOptions = array('class' => 'profile-sidebar-menu');
     $this->id = 'profile-sidebar-menu';
     $this->activeCssClass = 'active';
     parent::init();
 }
開發者ID:stormrage-project,項目名稱:valkyrie-yii,代碼行數:7,代碼來源:WProfileSidebarMenu.php

示例10: init

 public function init()
 {
     $class = array('dropdown');
     $cssFile;
     if ($this->vertical) {
         $class[] = 'dropdown-vertical';
         if ($this->rtl) {
             $class[] = 'dropdown-vertical-rtl';
             $cssFile = 'dropdown.vertical.rtl.css';
         } else {
             $cssFile = 'dropdown.vertical.css';
         }
     } else {
         if ($this->upward) {
             $class[] = 'dropdown-upward';
             $cssFile = 'dropdown.upward.css';
         } else {
             $class[] = 'dropdown-horizontal';
             $cssFile = 'dropdown.css';
         }
     }
     $this->htmlOptions['class'] = implode(' ', $class);
     $basedir = dirname(__FILE__) . '/free-css-drop-down-menu';
     $baseUrl = Yii::app()->getAssetManager()->publish($basedir);
     // echo $baseUrl;
     // yii::app()->end();
     if ($this->themeCssFile == '') {
         switch ($this->theme) {
             case 'adobe':
                 $this->themeCssFile = 'adobe.com/default.css';
                 break;
             case 'flikr':
                 $this->themeCssFile = 'flikr.com/default.css';
                 break;
             case 'lwis':
                 $this->themeCssFile = 'lwis.celebrity/default.css';
                 break;
             case 'mtv':
                 $this->themeCssFile = 'mtv.com/default.css';
                 break;
             case 'nvidia':
                 $this->themeCssFile = 'nvidia.com/default.css';
                 break;
             case 'vimeo':
                 $this->themeCssFile = 'vimeo.com/default.css';
                 break;
             case 'default':
             default:
                 $this->themeCssFile = 'default/default.css';
                 break;
         }
     }
     Yii::app()->getClientScript()->registerCSSFile($baseUrl . '/css/dropdown/' . $cssFile)->registerCSSFile($baseUrl . '/css/dropdown/themes/' . $this->themeCssFile);
     //  Yii::app()->getClientScript()->registerScriptFile($baseUrl.'/js/jqueryslidemenu.js');
     // Yii::app()->getClientScript()->registerCSSFile($baseUrl.'/css/jqueryslidemenu.css');
     //ToDo: these should added just for IE7, i don't know how to do this
     //            Yii::app()->getClientScript()->registerCoreScript('jquery')
     //                                            ->registerScriptFile($baseUrl.'/js/jquery.dropdown.js');
     parent::init();
 }
開發者ID:hipogea,項目名稱:zega,代碼行數:60,代碼來源:EMenu.php

示例11: init

 public function init()
 {
     $model = MenuModel::model()->enabled()->findAll();
     $result = array();
     foreach ($model as $item) {
         $result[] = array('label' => $item->label, 'url' => $item->url, 'active' => $this->isActive($item->url));
     }
     $this->items = CMap::mergeArray($result, $this->items);
     parent::init();
 }
開發者ID:buildshop,項目名稱:bs-common,代碼行數:10,代碼來源:MenuWidget.php

示例12: init

 public function init()
 {
     for ($i = 2013; $i <= date("Y"); $i++) {
         if ($i == $this->id_select) {
             echo "<option value='" . $i . "' selected>" . $i . "</option>";
         } else {
             echo "<option value='" . $i . "'>" . $i . "</option>";
         }
     }
     parent::init();
 }
開發者ID:robebeye,項目名稱:sim-kk,代碼行數:11,代碼來源:SelectOpTahun.php

示例13: init

 public function init()
 {
     // Here we define query conditions.
     $criteria = new CDbCriteria();
     //$criteria->condition = '`status` = 1';
     $criteria->order = '`id` ASC';
     $items = CmsvideoMenu::model()->findAll($criteria);
     foreach ($items as $item) {
         $this->items[] = array('label' => $item->menu_text, 'url' => $item->menu_link);
     }
     parent::init();
 }
開發者ID:videocms,項目名稱:videocms-test,代碼行數:12,代碼來源:ActiveMenu.php

示例14: init

 public function init()
 {
     $items = SideBarMenu::model()->findAll();
     foreach ($items as $item) {
         if ($item->id_parent == 0) {
             //  $categories[(int)$item->id] =  array((int)$item->id=>array('name'=>$item->name)) ; // рабочее
             $this->items[$item->id] = array('label' => ' <i class="' . $item->icon_class . '"></i><span>' . $item->name . '</span>', 'url' => array($item->url));
         } else {
             //   $categories[(int)$item->id_parent][(int)$item->id]=array($item->name) ; // рабочее
             $this->items[$item->id_parent]['items'][] = array('label' => $item->name, 'url' => array($item->url), 'submenuOptions' => array('class' => 'has-child', 'style' => 'display: list-item;'));
         }
     }
     parent::init();
 }
開發者ID:ZloyBarsuk,項目名稱:synapsis,代碼行數:14,代碼來源:ActiveMenu.php

示例15: init

 public function init()
 {
     if (!$this->getId(false)) {
         $this->setId('nav');
     }
     // add the script
     $cs = Yii::app()->getClientScript();
     $cs->registerCoreScript('jquery');
     $this->nljs = "\n";
     $this->items = $this->cssParentItems($this->items);
     $js = $this->createJsCode();
     $cs->registerScript('mainmenu_' . $this->getId(), $js, CClientScript::POS_READY);
     parent::init();
 }
開發者ID:ngdvan,項目名稱:lntguitar,代碼行數:14,代碼來源:MainMenu.php


注:本文中的CMenu類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。