Skip to content
This repository has been archived by the owner on Sep 14, 2018. It is now read-only.

Commit

Permalink
Add .twig file extension to templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jonseg authored and fabpot committed Jun 1, 2015
1 parent 4a4498a commit 885ad8d
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/controllers.php
Expand Up @@ -9,7 +9,7 @@
//Request::setTrustedProxies(array('127.0.0.1'));

$app->get('/', function () use ($app) {
return $app['twig']->render('index.html', array());
return $app['twig']->render('index.html.twig', array());
})
->bind('homepage')
;
Expand All @@ -21,10 +21,10 @@

// 404.html, or 40x.html, or 4xx.html, or error.html
$templates = array(
'errors/'.$code.'.html',
'errors/'.substr($code, 0, 2).'x.html',
'errors/'.substr($code, 0, 1).'xx.html',
'errors/default.html',
'errors/'.$code.'.html.twig',
'errors/'.substr($code, 0, 2).'x.html.twig',
'errors/'.substr($code, 0, 1).'xx.html.twig',
'errors/default.html.twig',
);

return new Response($app['twig']->resolveTemplate($templates)->render(array('code' => $code)), $code);
Expand Down
@@ -1,4 +1,4 @@
{% extends "layout.html" %}
{% extends "layout.html.twig" %}

{% block content %}
Page not found.
Expand Down
@@ -1,4 +1,4 @@
{% extends "layout.html" %}
{% extends "layout.html.twig" %}

{% block content %}
An error occurred on the client.
Expand Down
@@ -1,4 +1,4 @@
{% extends "layout.html" %}
{% extends "layout.html.twig" %}

{% block content %}
Internal server error.
Expand Down
@@ -1,4 +1,4 @@
{% extends "layout.html" %}
{% extends "layout.html.twig" %}

{% block content %}
An error occurred on the server.
Expand Down
@@ -1,4 +1,4 @@
{% extends "layout.html" %}
{% extends "layout.html.twig" %}

{% block content %}
An error occurred.
Expand Down
2 changes: 1 addition & 1 deletion templates/index.html → templates/index.html.twig
@@ -1,4 +1,4 @@
{% extends "layout.html" %}
{% extends "layout.html.twig" %}

{% block content %}
Welcome to your new Silex Application!
Expand Down
File renamed without changes.

0 comments on commit 885ad8d

Please sign in to comment.