Created
September 19, 2013 02:24
-
-
Save Bolinha1/6618407 to your computer and use it in GitHub Desktop.
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 | |
| require_once 'vendor/autoload.php'; | |
| use Silex\Application; | |
| use Symfony\Component\HttpFoundation\Request; | |
| use Symfony\Component\Templating\PhpEngine; | |
| use Symfony\Component\Templating\TemplateNameParser; | |
| use Symfony\Component\Templating\Loader\FilesystemLoader; | |
| class ControllerApp | |
| { | |
| public function index() | |
| { | |
| $loader = new FilesystemLoader(__DIR__.'/src/view/site/%name%'); | |
| $templating = new PhpEngine(new TemplateNameParser(), $loader); | |
| return $templating->render('index.php'); | |
| } | |
| public function quemSomos() | |
| { | |
| $loader = new FilesystemLoader(__DIR__.'/src/view/site/%name%'); | |
| $templating = new PhpEngine(new TemplateNameParser(), $loader); | |
| return $templating->render('quemSomos.php'); | |
| } | |
| public function nossosTrabalhos() | |
| { | |
| $loader = new FilesystemLoader(__DIR__.'/src/view/site/%name%'); | |
| $templating = new PhpEngine(new TemplateNameParser(), $loader); | |
| return $templating->render('trabalhos.php'); | |
| } | |
| public function contatos() | |
| { | |
| $loader = new FilesystemLoader(__DIR__.'/src/view/site/%name%'); | |
| $templating = new PhpEngine(new TemplateNameParser(), $loader); | |
| return $templating->render('contato.php'); | |
| } | |
| } | |
| $app = new Application(); | |
| $app->get('/', 'ControllerApp::index'); | |
| $app->get('/quem-somos', 'ControllerApp::quemSomos'); | |
| $app->get('/nossos-trabalhos', 'ControllerApp::nossosTrabalhos'); | |
| $app->get('/contato', 'ControllerApp::contatos'); | |
| $app['debug'] = 'true'; | |
| $app->run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment