Skip to content
Permalink
Browse files

Remove form related tags form HtmlHelper.

The form related HTML generation is all done with string templates now.
These tags are not needed here anymore.
  • Loading branch information...
markstory committed Mar 6, 2014
1 parent 22d86ac commit 0e1da95f676f73d7da06d11d6d4292df03392689
Showing with 7 additions and 37 deletions.
  1. +0 −30 src/View/Helper/HtmlHelper.php
  2. +7 −7 tests/TestCase/View/Helper/HtmlHelperTest.php
@@ -48,29 +48,6 @@ class HtmlHelper extends Helper {
'metalink' => '<link href="%s"%s/>',
'link' => '<a href="%s"%s>%s</a>',
'mailto' => '<a href="mailto:%s" %s>%s</a>',
'form' => '<form action="%s"%s>',
'formend' => '</form>',
'input' => '<input name="%s"%s/>',
'textarea' => '<textarea name="%s"%s>%s</textarea>',
'hidden' => '<input type="hidden" name="%s"%s/>',
'checkbox' => '<input type="checkbox" name="%s" %s/>',
'checkboxmultiple' => '<input type="checkbox" name="%s[]"%s />',
'radio' => '<input type="radio" name="%s" id="%s"%s />%s',
'selectstart' => '<select name="%s"%s>',
'selectmultiplestart' => '<select name="%s[]"%s>',
'selectempty' => '<option value=""%s>&nbsp;</option>',
'selectoption' => '<option value="%s"%s>%s</option>',
'selectend' => '</select>',
'optiongroup' => '<optgroup label="%s"%s>',
'optiongroupend' => '</optgroup>',
'checkboxmultiplestart' => '',
'checkboxmultipleend' => '',
'password' => '<input type="password" name="%s" %s/>',
'file' => '<input type="file" name="%s" %s/>',
'file_no_model' => '<input type="file" name="%s" %s/>',
'submit' => '<input %s/>',
'submitimage' => '<input type="image" src="%s" %s/>',
'button' => '<button%s>%s</button>',
'image' => '<img src="%s" %s/>',
'tableheader' => '<th%s>%s</th>',
'tableheaderrow' => '<tr%s>%s</tr>',
@@ -79,25 +56,18 @@ class HtmlHelper extends Helper {
'block' => '<div%s>%s</div>',
'blockstart' => '<div%s>',
'blockend' => '</div>',
'hiddenblock' => '<div style="display:none;">%s</div>',
'tag' => '<%s%s>%s</%s>',
'tagstart' => '<%s%s>',
'tagend' => '</%s>',
'tagselfclosing' => '<%s%s/>',
'para' => '<p%s>%s</p>',
'parastart' => '<p%s>',
'label' => '<label for="%s"%s>%s</label>',
'fieldset' => '<fieldset%s>%s</fieldset>',
'fieldsetstart' => '<fieldset><legend>%s</legend>',
'fieldsetend' => '</fieldset>',
'legend' => '<legend>%s</legend>',
'css' => '<link rel="%s" type="text/css" href="%s" %s/>',
'style' => '<style type="text/css"%s>%s</style>',
'charset' => '<meta http-equiv="Content-Type" content="text/html; charset=%s" />',
'ul' => '<ul%s>%s</ul>',
'ol' => '<ol%s>%s</ol>',
'li' => '<li%s>%s</li>',
'error' => '<div%s>%s</div>',
'javascriptblock' => '<script%s>%s</script>',
'javascriptstart' => '<script>',
'javascriptlink' => '<script type="text/javascript" src="%s"%s></script>',
@@ -1819,14 +1819,14 @@ public function testUseTag() {
$result = $this->Html->useTag('unknowntag');
$this->assertEquals('', $result);
$result = $this->Html->useTag('formend');
$this->assertTags($result, '/form');
$result = $this->Html->useTag('blockend');
$this->assertEquals('</div>', $result);
$result = $this->Html->useTag('form', 'url', ' test');
$this->assertEquals('<form action="url" test>', $result);
$result = $this->Html->useTag('image', 'url', 'test');
$this->assertEquals('<img src="url" test/>', $result);
$result = $this->Html->useTag('form', 'example.com', array('test' => 'ok'));
$this->assertTags($result, array('form' => array('test' => 'ok', 'action' => 'example.com')));
$result = $this->Html->useTag('image', 'example.com', array('test' => 'ok'));
$this->assertEquals('<img src="example.com" test="ok"/>', $result);
}
/**
@@ -2093,7 +2093,7 @@ public function testLoadConfig() {
$tags = $this->Html->getAttribute('_tags');
$this->assertEquals('start form', $tags['form']);
$this->assertEquals('finish form', $tags['formend']);
$this->assertEquals('</select>', $tags['selectend']);
$this->assertEquals('</div>', $tags['blockend']);
$result = $this->Html->loadConfig(array('htmlhelper_minimized.ini', 'ini'), $path);
$expected = array(

0 comments on commit 0e1da95

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