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


PHP custom_menu_item::__construct方法代碼示例

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


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

示例1: __construct

 public function __construct(custom_menu_item $menunode)
 {
     parent::__construct($menunode->get_text(), $menunode->get_url(), $menunode->get_title(), $menunode->get_sort_order(), $menunode->get_parent());
     $this->children = $menunode->get_children();
     $matches = array();
     if (preg_match('/^\\[\\[([a-zA-Z0-9\\-\\_\\:]+)\\]\\]$/', $this->text, $matches)) {
         try {
             $this->text = get_string($matches[1], 'theme_rocket');
         } catch (Exception $e) {
             $this->text = $matches[1];
         }
     }
     $matches = array();
     if (preg_match('/^\\[\\[([a-zA-Z0-9\\-\\_\\:]+)\\]\\]$/', $this->title, $matches)) {
         try {
             $this->title = get_string($matches[1], 'theme_rocket');
         } catch (Exception $e) {
             $this->title = $matches[1];
         }
     }
 }
開發者ID:Herrerapan,項目名稱:moodle-theme_rocket,代碼行數:21,代碼來源:lib.php

示例2: __construct

 /**
  * Creates the custom menu
  *
  * @param string $definition the menu items definition in syntax required by {@link convert_text_to_menu_nodes()}
  * @param string $currentlanguage the current language code, null disables multilang support
  */
 public function __construct($definition = '', $currentlanguage = null)
 {
     $this->currentlanguage = $currentlanguage;
     parent::__construct('root');
     // create virtual root element of the menu
     if (!empty($definition)) {
         $this->override_children(self::convert_text_to_menu_nodes($definition, $currentlanguage));
     }
 }
開發者ID:jtibbetts,項目名稱:moodle,代碼行數:15,代碼來源:outputcomponents.php

示例3: __construct

 /**
  * Creates the custom menu
  * @param string $text Sets the text for this custom menu, never gets used and is optional
  */
 public function __construct($text='base') {
     global $CFG;
     parent::__construct($text);
     if (!empty($CFG->custommenuitems)) {
         $this->override_children(self::convert_text_to_menu_nodes($CFG->custommenuitems));
     }
 }
開發者ID:nuckey,項目名稱:moodle,代碼行數:11,代碼來源:outputcomponents.php


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