Browse files

Remove old _tags property and useTag() method.

Both of these are not really that useful. useTag can be replaced with
tag(), I'm not really sure why we ever had both.
  • Loading branch information...
1 parent 5c49e13 commit c818a07444946f06a693bf1381bcce7dbd5d9c7c @markstory markstory committed Mar 8, 2014
Showing with 0 additions and 76 deletions.
  1. +0 −57 src/View/Helper/HtmlHelper.php
  2. +0 −19 tests/TestCase/View/Helper/HtmlHelperTest.php
View
57 src/View/Helper/HtmlHelper.php
@@ -42,42 +42,6 @@ class HtmlHelper extends Helper {
public $response;
/**
- * html tags used by this helper.
- *
- * @var array
- */
- protected $_tags = array(
- 'meta' => '<meta%s/>',
- 'metalink' => '<link href="%s"%s/>',
- 'link' => '<a href="%s"%s>%s</a>',
- 'mailto' => '<a href="mailto:%s" %s>%s</a>',
- 'image' => '<img src="%s" %s/>',
- 'tableheader' => '<th%s>%s</th>',
- 'tableheaderrow' => '<tr%s>%s</tr>',
- 'tablecell' => '<td%s>%s</td>',
- 'tablerow' => '<tr%s>%s</tr>',
- 'block' => '<div%s>%s</div>',
- 'blockstart' => '<div%s>',
- 'blockend' => '</div>',
- 'tag' => '<%s%s>%s</%s>',
- 'tagstart' => '<%s%s>',
- 'tagend' => '</%s>',
- 'tagselfclosing' => '<%s%s/>',
- 'para' => '<p%s>%s</p>',
- 'parastart' => '<p%s>',
- '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>',
- 'javascriptblock' => '<script%s>%s</script>',
- 'javascriptstart' => '<script>',
- 'javascriptlink' => '<script type="text/javascript" src="%s"%s></script>',
- 'javascriptend' => '</script>'
- );
-
-/**
* Default templates the helper users.
*
* @var array
@@ -970,27 +934,6 @@ public function tag($name, $text = null, $options = array()) {
}
/**
- * Returns a formatted existent block of $tags
- *
- * @param string $tag Tag name
- * @return string Formatted block
- * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#HtmlHelper::useTag
- */
- public function useTag($tag) {
- if (!isset($this->_tags[$tag])) {
- return '';
- }
- $args = func_get_args();
- array_shift($args);
- foreach ($args as &$arg) {
- if (is_array($arg)) {
- $arg = $this->_templater->formatAttributes($arg);
- }
- }
- return vsprintf($this->_tags[$tag], $args);
- }
-
-/**
* Returns a formatted DIV tag for HTML FORMs.
*
* ### Options
View
19 tests/TestCase/View/Helper/HtmlHelperTest.php
@@ -1751,25 +1751,6 @@ public function testTag() {
}
/**
- * testUseTag method
- *
- * @return void
- */
- public function testUseTag() {
- $result = $this->Html->useTag('unknowntag');
- $this->assertEquals('', $result);
-
- $result = $this->Html->useTag('blockend');
- $this->assertEquals('</div>', $result);
-
- $result = $this->Html->useTag('image', 'url', 'test');
- $this->assertEquals('<img src="url" test/>', $result);
-
- $result = $this->Html->useTag('image', 'example.com', array('test' => 'ok'));
- $this->assertEquals('<img src="example.com" test="ok"/>', $result);
- }
-
-/**
* testDiv method
*
* @return void

0 comments on commit c818a07

Please sign in to comment.