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


PHP Menu::init方法代码示例

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


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

示例1: init

 function init()
 {
     parent::init();
     $menu = $this;
     $menu->current_menu_class = 'current';
     $menu->inactive_menu_class = '';
     $section = explode('_', $this->api->page);
     $this->template->trySet('section', $section[0]);
     switch ($section[0]) {
         case 'about':
         case 'whatsnew':
         case 'newsletter':
             $this->api->template->trySet('menu_about', 'class="current"');
             $menu->addMenuItem('About', 'about/about');
             $menu->addMenuItem('What\'s New?', 'whatsnew');
             $menu->addMenuItem('Features', 'about/features');
             $menu->addMenuItem('Authors', 'about/authors');
             $menu->addMenuItem('License', 'about/license');
             break;
         case 'doc':
         case 'example':
         case 'learn':
         case 'a':
         case 'intro':
             $this->api->template->trySet('menu_doc', 'class="current"');
             $menu->addMenuItem('Introduction', 'intro');
             $menu->addMenuItem('Book', 'learn');
             $menu->addMenuItem('Documentation', 'doc');
             $menu->addMenuItem('Reference', 'doc/ref');
             //$menu->addMenuItem('Add-ons','a');
             $menu->addMenuItem('Examples', 'examples');
             break;
         case 'account':
         case 'community':
         case 'develop':
             $this->api->template->trySet('menu_develop', 'class="current"');
             $menu->addMenuItem('Account', 'account');
             $menu->addMenuItem('Resources', 'community/help');
             $menu->addMenuItem('Share Code', 'community/code');
             $menu->addMenuItem('Share Love', 'community/love');
             $menu->addMenuItem('Get Involved', 'develop/getinvolved');
             //$menu->addMenuItem('Addons','develop/addons');
             break;
         case 'commercial':
             $this->api->template->trySet('menu_services', 'class="current"');
             $menu->addMenuItem('Commercial Benefits', 'commercial/benefits');
             $menu->addMenuItem('License Store', 'commercial/store');
             $menu->addMenuItem('Use Cases', 'commercial/users');
             //$menu->addMenuItem('Products','commercial/products');
             //$menu->addMenuItem('Jobs','commercial/jobs');
             break;
         case 'download':
             $this->api->template->trySet('menu_download', 'class="current"');
             break;
         default:
     }
 }
开发者ID:vikash124,项目名称:atk4-web,代码行数:57,代码来源:AtkMenu.php

示例2: init

 public function init()
 {
     parent::init();
 }
开发者ID:jayrulez,项目名称:yiisns,代码行数:4,代码来源:Navigation.php

示例3: displayName

<?php

namespace ATPCore\Model;

require_once "MenuItem.php";
class Menu extends \ATP\ActiveRecord
{
    public function displayName()
    {
        return $this->name;
    }
    public function getMenuItems()
    {
        $item = new \ATPCore\Model\MenuItem();
        $items = $item->loadMultiple(array('where' => 'menu_id = ?', 'orderBy' => 'sort_order ASC', 'data' => array($this->id)));
        return $items;
    }
}
Menu::init();
开发者ID:daemonalchemist,项目名称:atp-core,代码行数:19,代码来源:Menu.php

示例4: init

	function init(){
		parent::init();
		$menu=$this;

		$menu->current_menu_class='current';
		$menu->inactive_menu_class='';

		$section=explode('_',$this->api->page);
		$this->template->trySet('section',$section[0]);
		switch($section[0]){
			case'about':
			case'newsletter':
			case'intro': 
				$this->api->template->trySet('menu_about','class="current"');

				$menu->addMenuItem('About','about');
				$menu->addMenuItem('Features','about/features');
				$menu->addMenuItem('License','about/license');
				$menu->addMenuItem('History','about/history');
				$menu->addMenuItem('Contact','about/contact');

				break;


			case'doc': 
			case'example': 
				$this->api->template->trySet('menu_doc','class="current"');

				$menu->addMenuItem('Documentation','doc');
				$menu->addMenuItem('API Reference','doc/ref');
				$menu->addMenuItem('Screencasts','doc/sc');
				$menu->addMenuItem('Examples','example/list');

				break;

			case'whatsnew': 
			case'develop': 
				$this->api->template->trySet('menu_develop','class="current"');

				$menu->addMenuItem('What\'s New?','whatsnew');
				$menu->addMenuItem('Get Involved','develop/getinvolved');
				$menu->addMenuItem('Roadmap','develop/roadmap');
				$menu->addMenuItem('Addons','develop/addons');

				break;

			case'commercial':
				$this->api->template->trySet('menu_services','class="current"');


				$menu->addMenuItem('Account','commercial');
				$menu->addMenuItem('Prices','commercial/store');
				$menu->addMenuItem('Services','commercial/services');
				//$menu->addMenuItem('Products','commercial/products');
				$menu->addMenuItem('Jobs','commercial/jobs');

				break;
			case'download':
				$this->api->template->trySet('menu_download','class="current"');
				break;


			default:
		}
	}
开发者ID:nanomo,项目名称:atk4-web,代码行数:65,代码来源:AtkMenu.php

示例5: init

 function init()
 {
     parent::init();
     $this->addMenuItem('h', 'Home');
 }
开发者ID:xavocvijay,项目名称:atkschool,代码行数:5,代码来源:MyMenu.php


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