mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-17 06:48:59 +08:00
debug tool bar WIP
This commit is contained in:
@@ -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'.";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user