i have in database
Category:
id | name
1 | first
2 | second
etc
and:
News:
id | category | name
1 | 1 | one
2 | 2 | two
3 | 1 | three
4 | 2 | four
5 | 2 | five
ETC.
how is the best method for show this in TWIG?
FIRST
- one
- three
SECOND
- two
- four
- five
etc.
in Symfony 1.4 i can use get data from template PHP, but in Symfony 2 i must get all data in controllor, but how?