<meta charset="utf-8">
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
我试试这个
$this->Html->meta(array('charset'=>'utf-8'));
$this->Html->meta(array('content'=>'IE=edge,chrome=1'), array("http-equiv" => X-UA-Compatible));
$this->Html->meta("viewport", array("content" => width=device-width,initial-sacale=1.0));
$this->Html->meta("description");
$this->Html->meta("author");
但它不起作用...............
我是cakephp的新手....所以请帮我解决这个问题...
答案 0 :(得分:6)
试试这个 -
echo $this->Html->meta(
'keywords',//name
'enter any meta keyword here'//content
);
所以为此 -
<meta name="viewport" content="width=device-width, initial-scale=1.0">
echo $this->Html->meta(
'viewport',//name
'width=device-width, initial-scale=1.0'//content
);
docs了解详情和其他选项。
代表charset
- echo $this->Html->charset('ISO-8859-1');
尝试 -
echo $this->Html->meta(array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0', 'http-equiv' => "X-UA-Compatible"));
答案 1 :(得分:-1)
<?= $this->Html->meta(
false,
'ie=edge',
['http-equiv' => 'x-ua-compatible']
);
?>
....结果
<meta http-equiv="x-ua-compatible" content="ie=edge"/>