From ead3b0ecf622b2182f5024c87b9df06242ce5eff Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 3 Sep 2009 13:45:39 -0400 Subject: [PATCH] Allowing HtmlHelper::script() to take an array of options, allows for custom attributes to be added to script include tags. Test cases added. Fixes #2955 --- cake/libs/view/helpers/html.php | 31 +++++++++++++------ .../cases/libs/view/helpers/html.test.php | 13 ++++++-- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php index 57a3001f2..611e12404 100644 --- a/cake/libs/view/helpers/html.php +++ b/cake/libs/view/helpers/html.php @@ -88,7 +88,7 @@ class HtmlHelper extends AppHelper { 'error' => '%s', 'javascriptblock' => '', 'javascriptstart' => '', + 'javascriptlink' => '', 'javascriptend' => '' ); @@ -416,26 +416,34 @@ class HtmlHelper extends AppHelper { * * Can include one or many Javascript files. * - * @param mixed $url String or array of javascript files to include - * @param boolean $inline Whether script should be output inline or into scripts_for_layout. - * @param boolean $once Whether or not the script should be checked for uniqueness. If true scripts will only be + * #### Options + * + * - `inline` - Whether script should be output inline or into scripts_for_layout. + * - `once` - Whether or not the script should be checked for uniqueness. If true scripts will only be * included once, use false to allow the same script to be included more than once per request. + * + * @param mixed $url String or array of javascript files to include + * @param mixed $options Array of options, and html attributes see above. If boolean sets $options['inline'] = value * @return mixed String of