Level2.lu/src/app/level2/WebControllerProvider.php

30 lines
505 B
PHP

<?php
namespace level2;
use Silex\Application;
use Silex\ControllerProviderInterface;
class WebControllerProvider implements ControllerProviderInterface {
public function connect ( Application $app ) {
$ctr = $app['controllers_factory'];
$ctr->get('/', function() use ( $app ) {
return $app['twig']->render(
'level2.twig',
array(
'level2State' => Level2::getStatus()
)
);
});
return $ctr;
}
}