Verze: 0.2
- 0.6 (master)
- 0.5
- 0.4
- 0.3
- 0.2
Š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");
}
}