sogura
- sogura 回复了话题 include 文件问题
inc.header.php 和inc.footer.php 里面就只是静态的HTML代码,并且我在SiteController.php 中增加了一个
function actionMain(){ $this->render('main');}
的action - sogura 回复了话题 include 文件问题
我调成Yii 的包含方式出现如下的错误
Undefined variable: content 04 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 05 <meta http-equiv="content-language" content="zh-cn" /> 06 <!--#include virtual="inc.head.php"--> 07 <title></title> 08 <style type="text/css"> 09 </style> 10 </head> 12 <body> 13 <div id="wrapper"> 14 15 <?php $this->beginContent('/layouts/inc.header'); ?> 16 <?php echo $content; ?> 17 <?php $this->endContent(); ?> 18 <div id="main"> 19 20 </div> 21 <div id="functionalhtml"> 22 23 </div> 24 <?php $this->beginContent('/layouts/inc.footer'); ?> 25 <?php echo $content; ?> 26 <?php $this->endContent(); ?> 27 </div> 28 </body>
- sogura 发布了话题include 文件问题