本文整理汇总了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:
}
}
示例2: init
public function init()
{
parent::init();
}
示例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();
示例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:
}
}
示例5: init
function init()
{
parent::init();
$this->addMenuItem('h', 'Home');
}