소스 검색

initial implementation of Yii debugger.

Qiang Xue 12 년 전
부모
커밋
06f0b41c38
3개의 변경된 파일10개의 추가작업 그리고 2개의 파일을 삭제
  1. 7 0
      config/web.php
  2. 2 2
      views/layouts/main.php
  3. 1 0
      www/index.php

+ 7 - 0
config/web.php

@@ -3,6 +3,13 @@
 return array(
 	'id' => 'bootstrap',
 	'basePath' => dirname(__DIR__),
+	'preload' => array('debug'),
+	'modules' => array(
+		'debug' => array(
+			'class' => 'yii\debug\Module',
+			'enabled' => YII_DEBUG && YII_ENV === 'dev',
+		),
+	),
 	'components' => array(
 		'cache' => array(
 			'class' => 'yii\caching\FileCache',

+ 2 - 2
views/layouts/main.php

@@ -18,8 +18,8 @@ $this->registerAssetBundle('app');
 	<?php $this->head(); ?>
 </head>
 <body>
+<?php $this->beginBody(); ?>
 <div class="container">
-	<?php $this->beginBody(); ?>
 	<div class="masthead">
 		<h3 class="muted">My Company</h3>
 
@@ -57,8 +57,8 @@ $this->registerAssetBundle('app');
 			Template by <a href="http://twitter.github.io/bootstrap/">Twitter Bootstrap</a>
 		</p>
 	</div>
-	<?php $this->endBody(); ?>
 </div>
+<?php $this->endBody(); ?>
 </body>
 </html>
 <?php $this->endPage(); ?>

+ 1 - 0
www/index.php

@@ -2,6 +2,7 @@
 
 // comment out the following line to disable debug mode
 defined('YII_DEBUG') or define('YII_DEBUG', true);
+defined('YII_ENV') or define('YII_ENV', 'dev');
 
 require(__DIR__ . '/../vendor/yiisoft/yii2/yii/Yii.php');
 require(__DIR__ . '/../vendor/autoload.php');