debug tool bar WIP

This commit is contained in:
Qiang Xue
2013-05-15 19:15:01 -04:00
parent 490c57f5e2
commit e96fd0ea59
6 changed files with 100 additions and 9 deletions

View File

@@ -7,6 +7,7 @@
namespace yii\debug\controllers;
use Yii;
use yii\web\Controller;
/**
@@ -19,4 +20,15 @@ class DefaultController extends Controller
{
echo $tag;
}
public function actionToolbar($tag)
{
$file = Yii::$app->getRuntimePath() . "/debug/$tag.log";
if (preg_match('/^[\w\-]+$/', $tag) && is_file($file)) {
$data = json_decode(file_get_contents($file), true);
echo $this->renderPartial('toolbar', $data);
} else {
echo "Unable to find debug data tagged with '$tag'.";
}
}
}