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
This commit is contained in:
phpnut 2006-12-22 21:33:23 +00:00
parent 9283b97f01
commit c5ec6b0ea1
5 changed files with 19 additions and 7 deletions

View file

@ -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));
}
/**

View file

@ -28,6 +28,8 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CakePHP : <?php echo $title_for_layout;?></title>
<?php echo $html->charset(); ?>
<link rel="icon" href="<?php echo $this->webroot . 'favicon.ico';?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $this->webroot . 'favicon.ico';?>" type="image/x-icon" />
<?php echo $html->css('cake.generic');?>

View file

@ -28,7 +28,8 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $page_title?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<?php echo $html->charset(); ?>
<?php if(Configure::read() == 0) { ?>
<meta http-equiv="Refresh" content="<?php echo $pause?>;url=<?php echo $url?>"/>
<?php } ?>

View file

@ -2,7 +2,8 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CakePHP: the PHP Rapid Development Framework: <?php echo $title_for_layout;?></title>
<?php echo $html->charset('UTF-8');?>
<?php echo $html->charset();?>
<link rel="icon" href="<?php echo $this->webroot;?>favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $this->webroot;?>favicon.ico" type="image/x-icon" />
<?php echo $html->css('cake.generic');?>

View file

@ -32,7 +32,8 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $page_title?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<?php echo $html->charset();?>
<?php if(Configure::read() == 0) { ?>
<meta http-equiv="Refresh" content="<?php echo $pause?>;url=<?php echo $url?>"/>
<?php } ?>