mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-01 17:38:38 +00:00
Add listing clients
Rename route to be more consistive (ie: prefixed with developer_)
This commit is contained in:
parent
2c2308b783
commit
9bf15f0269
8 changed files with 162 additions and 16 deletions
|
@ -17,13 +17,17 @@ class DeveloperController extends Controller
|
|||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
return $this->render('WallabagCoreBundle:Developer:index.html.twig');
|
||||
$clients = $this->getDoctrine()->getRepository('WallabagApiBundle:Client')->findAll();
|
||||
|
||||
return $this->render('WallabagCoreBundle:Developer:index.html.twig', array(
|
||||
'clients' => $clients,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
*
|
||||
* @Route("/developer/client/create", name="create_client")
|
||||
* @Route("/developer/client/create", name="developer_create_client")
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
|
@ -56,7 +60,30 @@ class DeveloperController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* @Route("/developer/howto/first-app", name="howto-firstapp")
|
||||
* Remove a client.
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @Route("/developer/client/delete/{id}", requirements={"id" = "\d+"}, name="developer_delete_client")
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\RedirectResponse
|
||||
*/
|
||||
public function deleteClientAction(Request $request, Client $client)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->remove($client);
|
||||
$em->flush();
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'Client deleted'
|
||||
);
|
||||
|
||||
return $this->redirect($this->generateUrl('developer'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/developer/howto/first-app", name="developer_howto_firstapp")
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue