Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @Route("/aplikacja/kontrahenci", name="contractor_index")
- *
- * @param Request $request
- *
- * @return \Symfony\Component\HttpFoundation\Response
- */
- public function contractorAction(Request $request){
- $user = $this->getUser();
- if (!$user){
- return $this->render('errors/403.html.twig', array(
- 'message' => 'Brak dostępu'
- ));
- }
- $repo = $this->getDoctrine()->getRepository(Contractor::class);
- $contractors = $repo->findBy(array(
- 'user' => $user
- ));
- $paginator = $this->get('knp_paginator');
- $pagination = $paginator->paginate(is_null($contractors) ? array() : $contractors, $request->get('page', 1), 20);
- return $this->render('application/contractor/index.html.twig', array(
- 'contractors' => $pagination
- ));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement