Skip to content

Instantly share code, notes, and snippets.

@hhamon
Last active December 17, 2015 12:59
Show Gist options
  • Save hhamon/5613658 to your computer and use it in GitHub Desktop.
Save hhamon/5613658 to your computer and use it in GitHub Desktop.
<?php
require __DIR__.'/vendor/autoload.php';
$loader = new Twig_Loader_Filesystem(__DIR__.'/views');
$twig = new Twig_Environment($loader, array(
//'cache' => __DIR__.'/cache',
));
return $twig;
<?php
$fabien = array(
'name' => 'Fabien Potencier',
'biography' => "Fabien Potencier discovered the Web in 1994, at a time when connecting to the Internet was still associated with the harmful strident sounds of a modem. Being a developer by passion, he started to build websites with PHP5 in 2004 and created the Symfony framework to help SensioLabs, his company, leverage the power of PHP for its customers.",
);
$jeremy = array(
'name' => 'Jeremy Mikola',
'biography' => "Contributor to various projects in the Symfony2 ecosystem; alumnus of IAC and OpenSky and Exercise.com. I enjoy traveling long distances for food and tech conferences.",
);
$benjamin = array(
'name' => "Benjamin Eberlei",
'biography' => "Benjamin Eberlei works at Qafoo GmbH as IT-Consultant for quality assurance and software architecture He is project leader of the open-source object-relational mapper Doctrine and participates in several projects in the Symfony ecosystem."
);
$talks = array(
array(
'speaker' => $fabien,
'start_time' => '2013-05-22 09:30:00',
'level' => 'advanced',
'title' => "Have fun... coding with Fabien",
'description' => "I like to push the limits. In 1985, my first piece of code was about managing a portfolio of stocks. In 1990, I published a game written in 10 LOCs. In 2009, I tweeted an implementation of a service container in less than 140 chars. 2013... time for another challenge. What about packing a Symfony full-stack application in a single file? No phar, no compilation, everything in a single readable file: from assets to controllers, from templates to Composer configuration. This is an interesting challenge but it would come in handy in many situations like when you are reporting a bug that involves many layers and third-party code. So, is it possible to pack a Symfony full-stack application in one file? ... in less than 200 lines of code? Well, I'm not sure yet but attend my keynote at SymfonyLive Portland to see if I took up the challenge and learn a few tricks along the way about PHP and Symfony. The only thing I'm already sure about: your head is going to explode!",
),
array(
'speaker' => $jeremy,
'start_time' => '2013-05-22 11:00:00',
'level' => 'beginner',
'title' => "Real-time Data Aggregation with MongoDB",
'description' => "Real-time analytics dashboards, nightly reports and ad hoc querying are just some of the ways we make sense of data. Each entails its own set of design constraints, benefits and trade-offs. Originally, map/reduce or data warehousing (i.e. exporting to an RDBMS) was the only option for data aggregation in MongoDB; however, version 2.2 introduced a new aggregation framework. Modeled after UNIX pipes, this framework combines the simplicity of SQL aggregation operators (e.g. min, group by) with the power of map/reduce and performance we've come to expect from MongoDB. In the latter half of this talk, we will look at a few PHP applications demonstrating the aggregation framework in action.",
),
array(
'speaker' => $benjamin,
'start_time' => '2013-05-22 14:00:00',
'level' => 'intermediate',
'title' => "Functional Testing with Symfony2",
'description' => "Functional tests are one of several corner-stones of quality assurance in any project. This session introduces functional testing and explains its usage in the context of Symfony2. We will take a look at the Browser, Crawler and CssSelector components that are specifically made for functional testing and finish with common use-cases and best-practices.",
),
);
return array(
'available_tickets' => 15,
'conference_name' => 'ACME Conference',
'speakers' => array($fabien, $jeremy, $benjamin),
'talks' => $talks,
);
<?php
$twig = include 'bootstrap.php';
echo $twig->render('index.html', array('name' => 'Hugo'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment