当前位置: 首页>>代码示例>>PHP>>正文


PHP CMenu::init方法代码示例

本文整理汇总了PHP中CMenu::init方法的典型用法代码示例。如果您正苦于以下问题:PHP CMenu::init方法的具体用法?PHP CMenu::init怎么用?PHP CMenu::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CMenu的用法示例。


在下文中一共展示了CMenu::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public function init()
 {
     if (!empty($this->class)) {
         $this->htmlOptions['class'] = $this->class;
     }
     parent::init();
 }
开发者ID:nickgr6,项目名称:Datepicker,代码行数:7,代码来源:DMenu.php

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: init

 /**
  * Initializes the menu widget.
  */
 public function init()
 {
     if (isset($this->htmlOptions['class'])) {
         $this->htmlOptions['class'] .= ' ' . $this->type;
     } else {
         $this->htmlOptions['class'] = $this->type;
     }
     parent::init();
 }
开发者ID:vangogogo,项目名称:justsns,代码行数:12,代码来源:BootMenu.php

示例10: 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

示例11: init

 /**
  * Initialize the widget
  */
 public function init()
 {
     // if (!$this->getId(false))
     //    $this->setId('cssmenu');
     $this->nljs = "\n";
     $this->items = $this->cssParentItems($this->items);
     //$this->items=$this->cssLastItems($this->items);
     parent::init();
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:12,代码来源:MenuCategoryShop.php

示例12: init

 /**
  * Initialize the widget
  */
 public function init()
 {
     if (!$this->getId(false)) {
         $this->setId('nav');
     }
     $this->nljs = "\n";
     $this->items = $this->cssParentItems($this->items);
     $this->items = $this->cssLastItems($this->items);
     parent::init();
 }
开发者ID:cfede10,项目名称:logisoft,代码行数:13,代码来源:MbMenu.php

示例13: 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

示例14: 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

示例15: 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


注:本文中的CMenu::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。