wallabag/src/WallabagBundle/Controller/EntryController.php

71 lines
1.8 KiB
PHP
Raw Normal View History

2015-01-22 16:18:56 +00:00
<?php
namespace WallabagBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use WallabagBundle\Repository;
class EntryController extends Controller
{
/**
* @Route("/unread", name="unread")
*/
2015-01-22 20:11:22 +00:00
public function showUnreadAction()
2015-01-22 16:18:56 +00:00
{
$repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries');
$entries = $repository->findUnreadByUser(1);
return $this->render(
'WallabagBundle:Entry:entries.html.twig',
array('entries' => $entries)
);
}
2015-01-22 20:11:22 +00:00
/**
* @Route("/archive", name="archive")
*/
public function showArchiveAction()
{
$repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries');
$entries = $repository->findArchiveByUser(1);
return $this->render(
'WallabagBundle:Entry:entries.html.twig',
array('entries' => $entries)
);
}
/**
* @Route("/starred", name="starred")
*/
public function showStarredAction()
{
$repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries');
$entries = $repository->findStarredByUser(1);
return $this->render(
'WallabagBundle:Entry:entries.html.twig',
array('entries' => $entries)
);
}
/**
* @Route("/view/{id}", requirements={"id" = "\d+"}, name="view")
*/
public function viewAction($id)
{
$repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries');
$entry = $repository->find($id);
return $this->render(
'WallabagBundle:Entry:entry.html.twig',
array('entry' => $entry)
);
}
2015-01-22 16:18:56 +00:00
}