Skip to content

Instantly share code, notes, and snippets.

@NandoKstroNet
Created July 26, 2017 14:14
Show Gist options
  • Save NandoKstroNet/eacdf3850db66a8e49b35fe581954703 to your computer and use it in GitHub Desktop.
Save NandoKstroNet/eacdf3850db66a8e49b35fe581954703 to your computer and use it in GitHub Desktop.
Conteúdo criado na série de posts sobre testes no Silex pela Code Experts Learning https://codeexpertslearning.com.br
<?php
use Silex\Application;
$app = new Application();
$app['debug'] = true;
$app->get('/', function(Application $app){
return $app['twig']->render('index.html.twig');
});
$app->get('/noticia/{slug}', function(Application $app, $slug){
return $app['twig']->render('post.html.twig',[
'slug' => $slug
]);
});
$app->register(new Silex\Provider\TwigServiceProvider(),
[
'twig.path' => __DIR__ . '/views/',
]
);
return $app;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment