Skip to content

Instantly share code, notes, and snippets.

@caefer
Created September 28, 2011 15:47
Show Gist options
  • Save caefer/1248287 to your computer and use it in GitHub Desktop.
Save caefer/1248287 to your computer and use it in GitHub Desktop.
<?php
require_once __DIR__.'/silex.phar';
$app = new Silex\Application();
$app->register(new Silex\Provider\TwigServiceProvider(), array(
'twig.path' => __DIR__.'/views',
'twig.class_path' => 'phar://'.__DIR__.'/twig.phar/lib',
));
$app->post('/', function() use($app) {
return $app['twig']->render('hello.twig', array(
'name' => 'World'
));
});
$app->run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment