Commit 37864402 by Qiang Xue

Fixes #4762: Reverted automatic ID fix.

parent 22839d92
...@@ -1908,6 +1908,6 @@ class BaseHtml ...@@ -1908,6 +1908,6 @@ class BaseHtml
public static function getInputId($model, $attribute) public static function getInputId($model, $attribute)
{ {
$name = strtolower(static::getInputName($model, $attribute)); $name = strtolower(static::getInputName($model, $attribute));
return str_replace(['[]', '][', '[', ']', ' ', '.'], ['', '-', '-', '', '-', '-'], $name); return str_replace(['[]', '][', '[', ']', ' '], ['', '-', '-', '', '-'], $name);
} }
} }
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
namespace yiiunit\framework\helpers; namespace yiiunit\framework\helpers;
use Yii; use Yii;
use yii\base\DynamicModel;
use yii\helpers\Html; use yii\helpers\Html;
use yiiunit\TestCase; use yiiunit\TestCase;
...@@ -158,13 +157,6 @@ class HtmlTest extends TestCase ...@@ -158,13 +157,6 @@ class HtmlTest extends TestCase
$this->assertEquals('<button type="reset" class="t" name="test" value="value">content<></button>', Html::resetButton('content<>', ['name' => 'test', 'value' => 'value', 'class' => 't'])); $this->assertEquals('<button type="reset" class="t" name="test" value="value">content<></button>', Html::resetButton('content<>', ['name' => 'test', 'value' => 'value', 'class' => 't']));
} }
public function testInputId()
{
$model = new DynamicModel(['test', 'relation.name']);
$this->assertEquals('<input type="text" id="dynamicmodel-test" name="DynamicModel[test]">', Html::activeTextInput($model, 'test'));
$this->assertEquals('<input type="text" id="dynamicmodel-relation-name" name="DynamicModel[relation.name]">', Html::activeTextInput($model, 'relation.name'));
}
public function testInput() public function testInput()
{ {
$this->assertEquals('<input type="text">', Html::input('text')); $this->assertEquals('<input type="text">', Html::input('text'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment