Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
2eda2725
Commit
2eda2725
authored
Sep 25, 2014
by
Nghia Nguyen
Committed by
Alexander Makarov
Sep 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #5164: Added `Inlfector::$transliterator` that can be used to customize intl transliteration
parent
df991951
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
BaseInflector.php
framework/helpers/BaseInflector.php
+7
-2
No files found.
framework/CHANGELOG.md
View file @
2eda2725
...
...
@@ -220,6 +220,7 @@ Yii Framework 2 Change Log
-
Enh #5117: Added
`beforeFilter`
and
`afterFilter`
JS events to
`GridView`
(kartik-v)
-
Enh #5124: Added support to prevent duplicated form submission when using
`ActiveForm`
(qiangxue)
-
Enh #5131: Added
`$autoRenew`
parameter to
`yii\web\User::getIdentity()`
(qiangxue)
-
Enh #5164: Added
`Inlfector::$transliterator`
that can be used to customize intl transliteration (zinzinday)
-
Enh: Added support for using sub-queries when building a DB query with
`IN`
condition (qiangxue)
-
Enh: Supported adding a new response formatter without the need to reconfigure existing formatters (qiangxue)
-
Enh: Added
`yii\web\UrlManager::addRules()`
to simplify adding new URL rules (qiangxue)
...
...
framework/helpers/BaseInflector.php
View file @
2eda2725
...
...
@@ -231,7 +231,12 @@ class BaseInflector
'ø'
=>
'o'
,
'ù'
=>
'u'
,
'ú'
=>
'u'
,
'û'
=>
'u'
,
'ü'
=>
'u'
,
'ű'
=>
'u'
,
'ý'
=>
'y'
,
'þ'
=>
'th'
,
'ÿ'
=>
'y'
,
];
/**
* @var mixed Either a [[Transliterator]] or a string from which a [[Transliterator]]
* can be built for transliteration used by [[slug()]] when intl is available.
* @see http://php.net/manual/en/transliterator.transliterate.php
*/
public
static
$transliterator
=
'Any-Latin; NFKD'
;
/**
* Converts a word to its plural form.
...
...
@@ -437,7 +442,7 @@ class BaseInflector
protected
static
function
transliterate
(
$string
)
{
if
(
static
::
hasIntl
())
{
return
transliterator_transliterate
(
'Any-Latin; NFKD'
,
$string
);
return
transliterator_transliterate
(
static
::
$transliterator
,
$string
);
}
else
{
return
str_replace
(
array_keys
(
static
::
$transliteration
),
static
::
$transliteration
,
$string
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment