Skip to content
Permalink
Browse files

refs #6635 FormHelper::radio() return collect id attributes with mult…

…ibyte
  • Loading branch information...
nojimage committed May 25, 2015
1 parent 15f8853 commit 8ebc9cdd875f144a734d43978d618400962c5e58
Showing with 25 additions and 1 deletion.
  1. +19 −0 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
  2. +6 −1 lib/Cake/Utility/Inflector.php
@@ -3902,6 +3902,25 @@ public function testRadio() {
'/fieldset'
);
$this->assertTags($result, $expected);
$result = $this->Form->radio(
'Model.multibyte',
array('男性' => '男性')
);
$expected = array(
'input' => array(
'type' => 'hidden', 'name' => 'data[Model][multibyte]',
'id' => 'ModelMultibyte_', 'value' => '',
),
array('input' => array(
'type' => 'radio', 'name' => 'data[Model][multibyte]',
'id' => 'ModelMultibyte男性', 'value' => '男性')
),
array('label' => array('for' => 'ModelMultibyte男性')),
'男性',
'/label',
);
$this->assertTags($result, $expected);
}
/**
@@ -495,7 +495,12 @@ public static function underscore($camelCasedWord) {
*/
public static function humanize($lowerCaseAndUnderscoredWord) {
if (!($result = self::_cache(__FUNCTION__, $lowerCaseAndUnderscoredWord))) {
$result = ucwords(str_replace('_', ' ', $lowerCaseAndUnderscoredWord));
$result = str_replace('_', ' ', $lowerCaseAndUnderscoredWord);
if (function_exists('mb_convert_case') && Multibyte::checkMultibyte($result)) {
$result = mb_convert_case($result, MB_CASE_TITLE, Configure::read('App.encoding'));
} else {
$result = ucwords($result);
}
self::_cache(__FUNCTION__, $lowerCaseAndUnderscoredWord, $result);
}
return $result;

0 comments on commit 8ebc9cd

Please sign in to comment.
You can’t perform that action at this time.