Created
July 26, 2017 14:14
-
-
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
This file contains hidden or 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
<?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