cloud_download Stáhnout

Šablony

config/framework.json

{
  "template": {
    "dir": "template/",
    "twig": {
      "cache": "cache/twig/"
    }
  }
}

cache/twig/

Složka musí mít právo na zápis.

src/App/Controller/DefaultController.php

<?php

namespace App\Controller;

use Gephart\Framework\Response\TemplateResponse;

final class DefaultController
{
    /**
     * @var TemplateResponse
     */
    private $response;

    public function __construct(TemplateResponse $template_response)
    {
        $this->response = $template_response;
    }

    /**
     * @Route /
     * @return TemplateResponse
     */
    public function index() {
        return $this->response->template("_framework/default.php");

        // Or twig template
        // return $this->response->template("_framework/default.html.twig");
    }
}