From e823ca1bf26ca74c4fc15fe87d59674b45654f72 Mon Sep 17 00:00:00 2001 From: nate Date: Tue, 27 Feb 2007 18:23:09 +0000 Subject: [PATCH] Fixing default JavaScript template, and code generation git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4562 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/view/helpers/js.php | 12 +++++++++++- cake/libs/view/templates/layouts/js/default.ctp | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 9abf02243..9bf4faf9d 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -115,7 +115,7 @@ class JsHelper extends Overloadable2 { * * @return string */ - function tryThese($expr1, $expr2, $expr3) { + function tryThese_($expr1, $expr2, $expr3) { } /** * Loads a remote URL @@ -162,6 +162,16 @@ class JsHelper extends Overloadable2 { } return $func; } +/** + * Redirects to a URL + * + * @param mixed $url + * @param array $options + * @return string + */ + function redirect_($url = null) { + return 'window.location = "' . Router::url($url) . '";'; + } /** * Escape a string to be JavaScript friendly. * diff --git a/cake/libs/view/templates/layouts/js/default.ctp b/cake/libs/view/templates/layouts/js/default.ctp index 63348249d..d94dc903a 100644 --- a/cake/libs/view/templates/layouts/js/default.ctp +++ b/cake/libs/view/templates/layouts/js/default.ctp @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file