mirror of
https://github.com/moparisthebest/wallabag
synced 2024-11-15 13:45:04 -05:00
[change] separation of controllers code
This commit is contained in:
parent
841d7f9cbe
commit
0a303e4353
@ -1,15 +1,18 @@
|
||||
<?php
|
||||
use Poche\Model\Entry;
|
||||
use Poche\Controller;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
$front = $app['controllers_factory'];
|
||||
$front->get('/', function () use ($app) {
|
||||
// $front->get('/', function () use ($app) {
|
||||
|
||||
$entries = $app['entry_api']->getEntries('unread');
|
||||
// $entries = $app['entry_api']->getEntries('unread');
|
||||
|
||||
return $app['twig']->render('index.twig', array('entries' => $entries));
|
||||
});
|
||||
// return $app['twig']->render('index.twig', array('entries' => $entries));
|
||||
// });
|
||||
|
||||
$front->get('/', 'Poche\Controller\EntryController::indexAction');
|
||||
|
||||
$front->get('/view/{id}', function (Request $request, $id) use ($app) {
|
||||
|
||||
|
20
src/Poche/Controller/EntryController.php
Normal file
20
src/Poche/Controller/EntryController.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Poche\Controller;
|
||||
|
||||
use Silex\Application;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* Entry controller.
|
||||
*/
|
||||
class EntryController
|
||||
{
|
||||
|
||||
public function indexAction(Request $request, Application $app)
|
||||
{
|
||||
$entries = $app['entry_api']->getEntries('unread');
|
||||
|
||||
return $app['twig']->render('index.twig', array('entries' => $entries));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user