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

35 lines
629 B
PHP
Raw Normal View History

2015-02-23 11:20:05 +01:00
<?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(
2015-02-23 11:44:12 +01:00
'level2.twig',
array(
'level2' => Level2::getStatus(),
'events' => array_slice(
Level2::getEvents( $app ),
0,
5
)
2015-02-23 11:44:12 +01:00
)
2015-02-23 11:20:05 +01:00
);
});
return $ctr;
}
}