Created
May 2, 2012 12:16
-
-
Save coreymcmahon/2576174 to your computer and use it in GitHub Desktop.
Bigger example of a Twig template - http://www.symfonycentral.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
{# title has been passed from the controller as an argument to 'render' #} | |
<title>{{ title|raw }}</title> | |
</head> | |
<body> | |
<nav> | |
<ul id="navigation"> | |
{# Here navigation is an array of arrays... #} | |
{% for item in navigation %} | |
<li><a href="{{ item.href }}">{{ item.title }}</a></li> | |
{% endfor %} | |
</ul> | |
</nav> | |
<header> | |
{# Use a function to generate some output #} | |
<img src="{{ asset('images/logo.png') }}" alt="Symfony!" /> | |
</header> | |
<article> | |
{# Access some variables Twig automatically sets-up for us #} | |
{% if app.session.hasFlash('notice') %} | |
<div class="flash-notice"> | |
{{ app.session.flash('notice') }} | |
</div> | |
{% endif %} | |
<!-- and so on and so on... --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment