Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow setting different type on scriptStart + scriptEnd

  • Loading branch information...
commit 6d996d52cef8b10960ce9e75609a658584540831 1 parent f19615a
@gilleswittenberg gilleswittenberg authored
View
14 lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
@@ -1150,6 +1150,20 @@ public function testScriptStartAndScriptEnd() {
);
$this->assertTags($result, $expected);
+ $result = $this->Html->scriptStart(array('safe' => true, 'type' => 'text/x-handlebars-template'));
+ $this->assertNull($result);
+ echo 'this is some template';
+
+ $result = $this->Html->scriptEnd();
+ $expected = array(
+ 'script' => array('type' => 'text/x-handlebars-template'),
+ $this->cDataStart,
+ 'this is some template',
+ $this->cDataEnd,
+ '/script'
+ );
+ $this->assertTags($result, $expected);
+
$this->View->expects($this->once())
->method('append');
$result = $this->Html->scriptStart(array('safe' => false, 'inline' => false));
View
2  lib/Cake/View/Helper/HtmlHelper.php
@@ -99,7 +99,7 @@ class HtmlHelper extends AppHelper {
'li' => '<li%s>%s</li>',
'error' => '<div%s>%s</div>',
'javascriptblock' => '<script%s>%s</script>',
- 'javascriptstart' => '<script type="text/javascript">',
+ 'javascriptstart' => '<script>',
'javascriptlink' => '<script type="text/javascript" src="%s"%s></script>',
'javascriptend' => '</script>'
);
Please sign in to comment.
Something went wrong with that request. Please try again.