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


PHP Convert::raw2htmlname方法代碼示例

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


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

示例1: testRaw2HtmlName

 public function testRaw2HtmlName()
 {
     $val1 = 'test test 123';
     $this->assertEquals('testtest123', Convert::raw2htmlname($val1));
 }
開發者ID:normann,項目名稱:sapphire,代碼行數:5,代碼來源:ConvertTest.php

示例2: get_menu_items

 /**
  * Get all menu entries.
  *
  * @return array
  */
 public static function get_menu_items()
 {
     $menuItems = array();
     // Set up default menu items
     if (!self::$menu_is_cleared) {
         $cmsClasses = self::get_cms_classes();
         foreach ($cmsClasses as $cmsClass) {
             $menuItem = self::menuitem_for_controller($cmsClass);
             if ($menuItem) {
                 $menuItems[Convert::raw2htmlname(str_replace('\\', '-', $cmsClass))] = $menuItem;
             }
         }
     }
     // Apply changes
     foreach (self::$menu_item_changes as $change) {
         switch ($change['type']) {
             case 'add':
                 $menuItems[$change['code']] = $change['item'];
                 break;
             case 'remove':
                 unset($menuItems[$change['code']]);
                 break;
             default:
                 user_error("Bad menu item change type {$change[type]}", E_USER_WARNING);
         }
     }
     // Sort menu items according to priority, then title asc
     $menuPriority = array();
     $menuTitle = array();
     foreach ($menuItems as $key => $menuItem) {
         $menuPriority[$key] = is_numeric($menuItem->priority) ? $menuItem->priority : 0;
         $menuTitle[$key] = $menuItem->title;
     }
     array_multisort($menuPriority, SORT_DESC, $menuTitle, SORT_ASC, $menuItems);
     return $menuItems;
 }
開發者ID:XDdesigners,項目名稱:silverstripe-framework,代碼行數:41,代碼來源:CMSMenu.php

示例3: get_menu_code

 /**
  * Get menu code for class
  *
  * @param string $cmsClass Controller class name
  * @return string
  */
 public static function get_menu_code($cmsClass)
 {
     return Convert::raw2htmlname(str_replace('\\', '-', $cmsClass));
 }
開發者ID:jacobbuck,項目名稱:silverstripe-framework,代碼行數:10,代碼來源:CMSMenu.php

示例4: menu_icon_for_class

 /**
  * Return styling for the menu icon, if a custom icon is set for this class
  *
  * Example: static $menu-icon = '/path/to/image/';
  * @param type $class
  * @return string
  */
 public static function menu_icon_for_class($class)
 {
     $icon = Config::inst()->get($class, 'menu_icon', Config::FIRST_SET);
     if (!empty($icon)) {
         $class = strtolower(Convert::raw2htmlname(str_replace('\\', '-', $class)));
         return ".icon.icon-16.icon-{$class} { background: url('{$icon}'); } ";
     }
     return '';
 }
開發者ID:maent45,項目名稱:redefine_renos,代碼行數:16,代碼來源:LeftAndMain.php

示例5: getFormField

 public function getFormField()
 {
     // Build label and css classes
     $label = '';
     $classes = $this->ExtraClass;
     if (empty($this->Title) || $this->HideLabel) {
         $classes .= " nolabel";
     } else {
         $label = "<label class='left'>{$this->EscapedTitle}</label>";
     }
     $field = new LiteralField("LiteralField[{$this->ID}]", sprintf("<div id='%s' class='field text%s'>\n\t\t\t\t\t%s\n\t\t\t\t\t<div class='middleColumn literalFieldArea'>%s</div>" . "</div>", Convert::raw2htmlname($this->Name), Convert::raw2att($classes), $label, $this->Content));
     // When dealing with literal fields there is no further customisation that can be added at this point
     return $field;
 }
開發者ID:camfindlay,項目名稱:silverstripe-userforms,代碼行數:14,代碼來源:EditableLiteralField.php


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