This commit is contained in:
2024-07-12 11:31:04 +03:00
parent 6d38f62e8d
commit 91dc9194e0
13 changed files with 38 additions and 32 deletions

View File

@ -1,14 +0,0 @@
<?php
namespace app\controllers;
class Controller
{
protected \Twig\Loader\FilesystemLoader $loader;
protected \Twig\Environment $twig;
public function __construct()
{
$this->loader = new \Twig\Loader\FilesystemLoader(__DIR__.'/../views');
$this->twig = new \Twig\Environment($this->loader, ['cache' => 'app/views/cache']);
}
}

View File

@ -2,12 +2,13 @@
namespace app\controllers;
use app\models\Question;
use kernel\Controller;
class QuestionController extends Controller{
public function actionCreate()
{
echo $this->twig->render('questionCreate.html');
echo $this->twig->render('question_create.html.twig');
}
public function actionGetQuestionsWithAnswers(): array

View File

@ -2,9 +2,9 @@
namespace app\controllers;
use app\helpers\Debug;
use app\models\Question;
use app\models\User;
use kernel\Controller;
class UserController extends Controller{
public function actionCreate(): void