bd
This commit is contained in:
30
src/app/controllers/MainController.php
Executable file
30
src/app/controllers/MainController.php
Executable file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace itguild\forms\app\controllers;
|
||||
|
||||
use itguild\forms\app\core\BaseController;
|
||||
use itguild\forms\debug\Debug;
|
||||
use itguild\forms\JsonForm;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
class MainController extends BaseController
|
||||
{
|
||||
private $html;
|
||||
|
||||
public function indexAction(): void
|
||||
{
|
||||
$this->view->addFunction(new TwigFunction("create_form", function (){
|
||||
$form = new JsonForm(file_get_contents("form.json"));
|
||||
$form->convertHTML();
|
||||
$form->render();
|
||||
}));
|
||||
|
||||
echo $this->view->render('main/index.html.twig', ['title' => 'Заголовок', 'content' => ""]);
|
||||
}
|
||||
|
||||
public function exampleAction()
|
||||
{
|
||||
echo "example";
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user