I\'m creating second route for display all articles by category in the URL. There is my route for that:
default_blog_category:
path: /category/{slug}
You have to join the categories. This code should be placed in the ArticleRepository.
$qb = $this->createQueryBuilder('a');
$qb->add('select', 'a');
$qb->leftJoin('a.category', 'c');
$qb->where('c.name LIKE :category'); /* i have guessed a.name */
$qb->setParameter('category', $slug);
$qb->getQuery()->getResult();
See doctrine query builder and symfony custom repository classes for an tutorial.