我想用语法生成CSS
标签。CakePhp
MyHTML
被成功省略但
CSS
没有调用。我已经把我的css放进去了 app\webroot\css
。
下面是我的代码。我正在使用以下 CakePhp 的语法。
我也在使用DebugKit
. 希望它不会造成任何问题。
echo $this->Html->meta('icon');
echo $this->Html->css('bootstrap');
echo $this->Html->css('bootstrap-responsive');
echo $this->Html->css('admin');
echo $this->fetch('meta');
echo $this->fetch('css');
echo $this->fetch('script');
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>Dashboard :: Base Admin</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<?php
echo $this->Html->meta('icon');
echo $this->Html->css('bootstrap');
echo $this->Html->css('bootstrap-responsive');
echo $this->Html->css('admin');
echo $this->fetch('meta');
echo $this->fetch('css');
echo $this->fetch('script');
?>
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="../assets/js/html5shiv.js"></script>
<![endif]-->
</head>
控制器
class AdminsController extends AppController {
var $helpers = array('Html','Form');
public function index() {
}
}
结果来了
<html lang="en">
<head>
<meta charset="utf-8">
<title>Dashboard :: Base Admin</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="../assets/js/html5shiv.js"></script>
<![endif]-->
</head>