当前位置: 首页>>代码示例>>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;未经允许,请勿转载。