Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Controller;
- use Symfony\Component\Routing\Annotation\Route;
- use Symfony\Bundle\FrameworkBundle\Controller\Controller;
- use Symfony\Component\HttpFoundation\Response;
- use Symfony\Component\HttpFoundation\Request;
- use App\Entity\Nutrizionista;
- use App\Entity\Utente;
- use App\Repository\UtenteRepository;
- class DefaultController extends Controller
- {
- /**
- * @Route("/", name="home")
- */
- public function homepage()
- {
- $em = $this->getDoctrine()->getManager();
- $lastnutrizionisti = $em->getRepository('App:Nutrizionista')->findBy(array(), array('id'=>'desc'), 4,0);
- $lastarticles = $em->getRepository('App:Articolo')->findBy(array(), array('id'=>'desc'), 4,0);
- $formSearch = $this->createForm('App\Form\SearchType', null);
- //$risultati = $em->getRepository('App:Utente')->findBySearch($formSearch->getData());
- // replace this example code with whatever you need
- return $this->render('default/index.html.twig', [
- //'risultati' => $risultati,
- 'form_search' => $formSearch->createView(),
- 'last_nutrizionisti' => $lastnutrizionisti,
- 'lastarticles' => $lastarticles,
- ]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement