fix headre
This commit is contained in:
parent
200763725e
commit
f24ce58b85
@ -15,6 +15,7 @@ use http\Message;
|
||||
use Itguild\Tables\ListJsonTable;
|
||||
use Itguild\Tables\ViewJsonTable;
|
||||
use JetBrains\PhpStorm\NoReturn;
|
||||
use kernel\App;
|
||||
use kernel\Controller;
|
||||
use kernel\IGTabel\btn\PrimaryBtn;
|
||||
use kernel\IGTabel\ListJsonTableEloquentCollection;
|
||||
@ -62,6 +63,7 @@ class UserController extends Controller{
|
||||
{
|
||||
// $users = User::where(['role' => 1])->get();
|
||||
$users = User::all();
|
||||
//App::$header->add("asd", "asd");
|
||||
|
||||
$this->cgView->render("user/index.php", ['users' => $users]);
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ $dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
|
||||
$dotenv->load();
|
||||
|
||||
include_once __DIR__ . "/bootstrap/db.php";
|
||||
include_once __DIR__ . "/bootstrap/header.php";
|
||||
const ROOT_DIR = __DIR__;
|
||||
const KERNEL_DIR = __DIR__ . "/kernel";
|
||||
const CONSOLE_DIR = __DIR__ . "/kernel/console";
|
||||
|
3
bootstrap/header.php
Normal file
3
bootstrap/header.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
\kernel\App::$header = new \kernel\Header();
|
@ -22,7 +22,7 @@ class App
|
||||
{
|
||||
$dispatcher = new Dispatcher(App::$collector->getData());
|
||||
$response = $dispatcher->dispatch($_SERVER['REQUEST_METHOD'], parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
|
||||
header('Content-Type: ' . App::$responseType);
|
||||
//header('Content-Type: ' . App::$responseType);
|
||||
App::$header->set();
|
||||
echo $response;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user