当前位置: 首页>>代码示例>>PHP>>正文


PHP URLify::language方法代码示例

本文整理汇总了PHP中URLify::language方法的典型用法代码示例。如果您正苦于以下问题:PHP URLify::language方法的具体用法?PHP URLify::language怎么用?PHP URLify::language使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在URLify的用法示例。


在下文中一共展示了URLify::language方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 /**
  * Initializes the character map.
  */
 private static function init($language = "")
 {
     if (count(self::$map) > 0 && ($language == "" || $language == self::$language)) {
         return;
     }
     /* Is a specific map associated with $language ? */
     if (isset(self::$maps[$language]) && is_array(self::$maps[$language])) {
         /* Move this map to end. This means it will have priority over others */
         $m = self::$maps[$language];
         unset(self::$maps[$language]);
         self::$maps[$language] = $m;
         /* Reset static vars */
         self::$language = $language;
         self::$map = array();
         self::$chars = '';
         self::$regex = '';
     }
     foreach (self::$maps as $map) {
         foreach ($map as $orig => $conv) {
             self::$map[$orig] = $conv;
             self::$chars .= $orig;
         }
     }
     self::$regex = '/[' . self::$chars . ']/u';
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:28,代码来源:URLify.php

示例2: init

 /**
  * Initializes the character map.
  *
  * @param string $language
  *
  * @return bool
  */
 private static function init($language = 'de')
 {
     // check if lang is set
     if (!$language) {
         return false;
     }
     // check if we already created the regex for this lang
     if (count(self::$map) > 0 && $language == self::$language) {
         return true;
     }
     // is a specific map associated with $language?
     if (isset(self::$maps[$language]) && is_array(self::$maps[$language])) {
         // move this map to end. This means it will have priority over others
         $m = self::$maps[$language];
         unset(self::$maps[$language]);
         self::$maps[$language] = $m;
     }
     // reset static vars
     self::$language = $language;
     self::$map = array();
     self::$chars = '';
     foreach (self::$maps as $map) {
         foreach ($map as $orig => $conv) {
             self::$map[$orig] = $conv;
             self::$chars .= $orig;
         }
     }
     self::$regex = '/[' . self::$chars . ']/u';
     return true;
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:37,代码来源:URLify.php


注:本文中的URLify::language方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。