Reputation: 31919
{% render "AcmeGolferBundle:Golfer:showGolfersList" %}
/**
* Lists all golfers.
*
* @Route("/golfersList", name="golfers_list")
* @Template()
*/
public function showGolfersListAction()
{
//....doStuff
}
In that case, the only use of the controller will be in that template. Is there a way to avoid the user to trigger the url directly, meaning /golferList
on its own?
The point I am trying to make is the following: I need the user to use the controller through the template it is embedded in, but not directly via the url. I realise this might not be possible, but because the controller is embedded, it doesn't have a proper css structure. Therefore, if it is triggered via the url directly, it will look pretty ugly on the page.
Upvotes: 1
Views: 580
Reputation: 17976
Securing route by IP might be useful for you:
security:
# ...
access_control:
- { path: ^/golferList, roles: IS_AUTHENTICATED_ANONYMOUSLY, ip: 127.0.0.1 }
Upvotes: 2