From c5ec6b0ea1d20d5ba8867489b6ed96b2f662c271 Mon Sep 17 00:00:00 2001 From: phpnut Date: Fri, 22 Dec 2006 21:33:23 +0000 Subject: [PATCH] Updating HtmlHelper::charset() to use Configure::read('charset) Updated core layouts to use $html->charset() git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4128 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/view/helpers/html.php | 9 ++++++++- cake/libs/view/templates/layouts/default.ctp | 2 ++ cake/libs/view/templates/layouts/flash.ctp | 3 ++- cake/scripts/templates/skel/views/layouts/default.ctp | 9 +++++---- cake/scripts/templates/skel/views/layouts/flash.ctp | 3 ++- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php index 47250367e..d3253c312 100644 --- a/cake/libs/view/helpers/html.php +++ b/cake/libs/view/helpers/html.php @@ -219,7 +219,14 @@ class HtmlHelper extends AppHelper { * @param string $charset * @return string */ - function charset($charset = 'UTF-8') { + function charset($charset = null) { + if(is_null($charset)){ + $charset = Configure::read('charset'); + if(is_null($charset)){ + $charset = 'utf-8'; + } + } + return $this->output(sprintf($this->tags['charset'], $charset)); } /** diff --git a/cake/libs/view/templates/layouts/default.ctp b/cake/libs/view/templates/layouts/default.ctp index d9221bacc..e6f9bd480 100644 --- a/cake/libs/view/templates/layouts/default.ctp +++ b/cake/libs/view/templates/layouts/default.ctp @@ -28,6 +28,8 @@ CakePHP : <?php echo $title_for_layout;?> +charset(); ?> + css('cake.generic');?> diff --git a/cake/libs/view/templates/layouts/flash.ctp b/cake/libs/view/templates/layouts/flash.ctp index 8af4e7565..f3ce2bdcd 100644 --- a/cake/libs/view/templates/layouts/flash.ctp +++ b/cake/libs/view/templates/layouts/flash.ctp @@ -28,7 +28,8 @@ <?php echo $page_title?> - +charset(); ?> + diff --git a/cake/scripts/templates/skel/views/layouts/default.ctp b/cake/scripts/templates/skel/views/layouts/default.ctp index 54f52ad7b..233f000d6 100644 --- a/cake/scripts/templates/skel/views/layouts/default.ctp +++ b/cake/scripts/templates/skel/views/layouts/default.ctp @@ -2,7 +2,8 @@ CakePHP: the PHP Rapid Development Framework: <?php echo $title_for_layout;?> -charset('UTF-8');?> +charset();?> + css('cake.generic');?> @@ -13,14 +14,14 @@

CakePHP: the PHP Rapid Development Framework

- check('Message.flash')): $session->flash(); endif; ?> - + - +