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


PHP Breadcrumb::create方法代碼示例

本文整理匯總了PHP中Breadcrumb::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP Breadcrumb::create方法的具體用法?PHP Breadcrumb::create怎麽用?PHP Breadcrumb::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Breadcrumb的用法示例。


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

示例1: breadcrumb

 /**
  * breadcrumb function
  * Create breadcrumb
  * @return string
  * @author joharijumali
  **/
 public static function breadcrumb()
 {
     $Menu = Admin_Menu::menuGenerator();
     $butternbread = array();
     foreach ($Menu as $floor => $packet) {
         foreach ($packet->page->action as $key => $action) {
             if ($packet->packet == Str::lower(URI::segment(1)) && $packet->controller->name == Str::lower(URI::segment(2)) && $action->name == Str::lower(URI::segment(3)) || URI::segment(3) == NULL && $action->name == $packet->controller->name && Str::lower(URI::segment(2)) == $packet->controller->name) {
                 $butternbread[Str::upper($packet->controller->alias)] = '#';
                 array_push($butternbread, Str::title($action->alias));
             }
         }
     }
     return Breadcrumb::create($butternbread);
 }
開發者ID:jigeeshup,項目名稱:bootstrap-base-application,代碼行數:20,代碼來源:Navigator.php

示例2: beforeFilter

 /**
  * beforeFilter function called before filter
  *
  * @access public
  * @return void
  */
 public function beforeFilter()
 {
     $timezone = $this->SysParameter->findByParameterCode('system.timezone');
     // default to UTC if no timezone is set
     if (!(empty($timezone) || empty($timezone['SysParameter']['parameter_value']))) {
         $timezone = $timezone['SysParameter']['parameter_value'];
         // check that the timezone is valid
         if (isset($this->validTZ[$timezone])) {
             date_default_timezone_set($timezone);
         } else {
             $this->Session->setFlash(__('An invalid timezone is provided, please edit "system.timezone"', true));
         }
     }
     $this->Auth->autoRedirect = false;
     // backward compatible with original ipeer hash  method
     Security::setHash('md5');
     Configure::write('Security.salt', '');
     $locale = $this->SysParameter->findByParameterCode('display.locale');
     // default to eng if no locale is set
     if (!(empty($locale) || empty($locale['SysParameter']['parameter_value']))) {
         $locale = $locale['SysParameter']['parameter_value'];
         // TODO: check that the locale is valid
         Configure::write('Config.language', $locale);
     } else {
         Configure::write('Config.language', 'eng');
     }
     // if we have a session transfered to us
     if ($this->_hasSessionTransferData()) {
         if ($this->_authenticateWithSessionTransferData()) {
             if (method_exists($this, '_afterLogin')) {
                 $this->_afterLogin(false);
             }
         } else {
             $this->Session->setFlash($this->Auth->loginError, $this->Auth->flashElement, array(), 'auth');
         }
     }
     // store user in the singleton for global access
     User::store($this->Auth->user());
     $this->breadcrumb = Breadcrumb::create();
     if ($this->Auth->isAuthorized()) {
         // check if the user has permission to access the controller/action
         $permission = array_filter(array('controllers', ucwords($this->params['plugin']), ucwords($this->params['controller']), $this->params['action']));
         if (!User::hasPermission(join('/', $permission))) {
             $this->Session->setFlash('Error: You do not have permission to access the page.');
             $this->redirect('/home');
             return;
         }
         $this->_checkSystemVersion();
     }
     // for setting up google analytics
     $trackingId = $this->SysParameter->findByParameterCode('google_analytics.tracking_id');
     $domain = $this->SysParameter->findByParameterCode('google_analytics.domain');
     $customLogo = $this->SysParameter->findByParameterCode('banner.custom_logo');
     $this->set('trackingId', $trackingId);
     $this->set('domain', $domain);
     $this->set('customLogo', $customLogo);
     parent::beforeFilter();
 }
開發者ID:eecian,項目名稱:Team08-iPeer,代碼行數:64,代碼來源:app_controller.php


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