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


PHP AkInflector::unaccent方法代码示例

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


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

示例1: _getUrlSafeName

 function _getUrlSafeName(&$record,$name)
 {
     
     $safe_name = strtolower($name);
     $safe_name = str_replace(array('ñ','ä','ü','ö','ß'),array('ny','ae','ue','oe','ss'), $safe_name);
     $safe_name = AkInflector::unaccent($safe_name);
     $specialCharsUnsafe =array("¡","!"," ","`","]","[","~","^","\\","|","}","{","%","#",">","<",
                                    "'",'"',"",'@','$','&',
                                    ',','/',':',';','=','?');
     $specialCharsSafe = array("-exclamation-","-exclamation-","-","-accent-","-rbracket-","-lbracket-","-tilde-","-caret-","-backslash-","-pipe-","-rbrace-","-lbrace-","-percent-","-hash-","-more-","-less-",
                               "","",'-','-at-','-dollar-','-and-',
                               '-comma-','-or-','-colon-','-semicolon-','-equals-','-question-');
     
     
     foreach (array_keys($record->sluggable->custom_replacements) as $customKey) {
         array_unshift($specialCharsUnsafe,$customKey);
         array_unshift($specialCharsSafe,$record->sluggable->custom_replacements[$customKey]);
     }
     
     $safe_name = str_replace($specialCharsUnsafe,
                              $specialCharsSafe,
                              $safe_name);
     $safe_name = preg_replace('/-+/','-',$safe_name);
     $safe_name = trim($safe_name,'-');
     return $safe_name;
 }
开发者ID:joeymetal,项目名称:v1,代码行数:26,代码来源:ActsAsSluggable.php

示例2: urlize

 static function urlize($text)
 {
     return trim(AkInflector::underscore(AkInflector::unaccent($text)), '_');
 }
开发者ID:bermi,项目名称:akelos,代码行数:4,代码来源:inflector.php

示例3: Test_of_unnaccent

 function Test_of_unnaccent()
 {
     $this->assertEqual('AAAAAAACEEEEIIIIDNOOOOOOUUUUYTsaaaaaaaceeeeiiiienoooooouuuuyty', AkInflector::unaccent('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ'));
 }
开发者ID:joeymetal,项目名称:v1,代码行数:4,代码来源:AkInflector.php


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