Advertisement
sanjiisan

Untitled

Sep 12th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. //showAllArticles
  2. {% for article in articles %}
  3. {{ include("CoderslabBundle:Article:showArticle.html.twig", {'article': article}) }}<br><br>
  4. {% endfor %}
  5.  
  6. //showArticle
  7. {{ article.id }}
  8. {{ article.title }}
  9. {{ article.articleText }}
  10.  
  11. //kontroller
  12. <?php
  13.  
  14. namespace CoderslabBundle\Controller;
  15.  
  16. use CoderslabBundle\Entity\Article;
  17. use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  18. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  19.  
  20. class DefaultController extends Controller
  21. {
  22. /**
  23. * @Route("/showAllArticles/")
  24. */
  25. public function showAllArticlesAction()
  26. {
  27. $articles = Article::GetAllArticles();
  28.  
  29. return $this->render('CoderslabBundle:Article:showArticles.html.twig',
  30. [
  31. 'articles' => $articles
  32. ]
  33. );
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement