Make the iCalendar work with the slugs.

This commit is contained in:
Tim Schumacher 2014-07-11 20:21:47 +02:00
parent 75a2ef9796
commit ab8236da0f
2 changed files with 8 additions and 8 deletions

View file

@ -35,7 +35,7 @@ class LocationController extends Controller
/**
* Finds and displays a Event entity.
*
* @Route("/{slug}", name="location_show")
* @Route("/{slug}(?!\.ics)", name="location_show")
* @Method("GET")
* @Template("CalciferBundle:Event:index.html.twig")
*/
@ -79,12 +79,12 @@ class LocationController extends Controller
/**
* Finds and displays a Event entity.
*
* @Route("/{id}.ics", requirements={"id" = "\d+"}, name="location_show_ics")
* @Route("/{slug}\.ics", name="location_show_ics")
* @Method("GET")
*/
public function showActionICS($id)
public function showActionICS($slug)
{
$results = $this->showAction(str_replace('.ics','',$id));
$results = $this->showAction(str_replace('.ics','',$slug));
$entities = $results['entities'];
$calendar = new Calendar();

View file

@ -35,7 +35,7 @@ class TagController extends Controller
/**
* Finds and displays a Event entity.
*
* @Route("/{slug}", name="tag_show")
* @Route("/{slug}(?!\.ics)", name="tag_show")
* @Method("GET")
* @Template("CalciferBundle:Event:index.html.twig")
*/
@ -76,12 +76,12 @@ class TagController extends Controller
/**
* Finds and displays a Event entity.
*
* @Route("/{id}.ics", requirements={"id" = "\d+"}, name="tag_show_ics")
* @Route("/{slug}.ics", name="tag_show_ics")
* @Method("GET")
*/
public function showActionICS($id)
public function showActionICS($slug)
{
$results = $this->showAction(str_replace('.ics','',$id));
$results = $this->showAction(str_replace('.ics','',$slug));
$entities = $results['entities'];
$calendar = new Calendar();