Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //showAllArticles
- {% for article in articles %}
- {{ include("CoderslabBundle:Article:showArticle.html.twig", {'article': article}) }}<br><br>
- {% endfor %}
- //showArticle
- {{ article.id }}
- {{ article.title }}
- {{ article.articleText }}
- //kontroller
- <?php
- namespace CoderslabBundle\Controller;
- use CoderslabBundle\Entity\Article;
- use Symfony\Bundle\FrameworkBundle\Controller\Controller;
- use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
- class DefaultController extends Controller
- {
- /**
- * @Route("/showAllArticles/")
- */
- public function showAllArticlesAction()
- {
- $articles = Article::GetAllArticles();
- return $this->render('CoderslabBundle:Article:showArticles.html.twig',
- [
- 'articles' => $articles
- ]
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement