Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace SoftUniBlogBundle\Controller;
- use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
- use SoftUniBlogBundle\Entity\Article;
- use Symfony\Bundle\FrameworkBundle\Controller\Controller;
- class HomeController extends Controller
- {
- /**
- * @Route("/", name="blog_index")
- * @return \Symfony\Component\HttpFoundation\Response
- */
- public function articles(){
- $repos = $this->getDoctrine()->getRepository(Article::class);
- $articles = $repos->findAll();
- return $this->render('default/index.html.twig', ['articles' => $articles]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement