mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 10:36:16 +00:00
Html::tag now accepts $attributes as a string, in which case, it will be used as the tags class name.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6859 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
65454882f3
commit
9a4c186ccd
2 changed files with 6 additions and 0 deletions
|
@ -525,6 +525,9 @@ class HtmlHelper extends AppHelper {
|
|||
if ($escape) {
|
||||
$text = h($text);
|
||||
}
|
||||
if (!is_array($attributes)) {
|
||||
$attributes = array('class' => $attributes);
|
||||
}
|
||||
if ($text === null) {
|
||||
$tag = 'tagstart';
|
||||
} else {
|
||||
|
|
|
@ -651,6 +651,9 @@ class HtmlHelperTest extends CakeTestCase {
|
|||
|
||||
$result = $this->Html->tag('div', '<text>', array('class' => 'class-name'), true);
|
||||
$this->assertTags($result, array('div' => array('class' => 'class-name'), '<text>', '/div'));
|
||||
|
||||
$result = $this->Html->tag('div', '<text>', 'class-name', true);
|
||||
$this->assertTags($result, array('div' => array('class' => 'class-name'), '<text>', '/div'));
|
||||
}
|
||||
|
||||
function testDiv() {
|
||||
|
|
Loading…
Add table
Reference in a new issue