<?xml version="1.0" encoding="UTF-8" ?>

<routes xmlns="http://symfony.com/schema/routing"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">

    <route id="{{ route_name_prefix }}" pattern="/">
        <default key="_controller">{{ bundle }}:{{ entity }}:index</default>
    </route>

    <route id="{{ route_name_prefix }}_show" pattern="/{id}/show">
        <default key="_controller">{{ bundle }}:{{ entity }}:show</default>
    </route>

{% if 'new' in actions %}
    <route id="{{ route_name_prefix }}_new" pattern="/new">
        <default key="_controller">{{ bundle }}:{{ entity }}:new</default>
    </route>

    <route id="{{ route_name_prefix }}_create" pattern="/create">
        <default key="_controller">{{ bundle }}:{{ entity }}:create</default>
        <requirement key="_method">post</requirement>
    </route>
{% endif %}

{% if 'edit' in actions %}
    <route id="{{ route_name_prefix }}_edit" pattern="/{id}/edit">
        <default key="_controller">{{ bundle }}:{{ entity }}:edit</default>
    </route>

    <route id="{{ route_name_prefix }}_update" pattern="/{id}/update">
        <default key="_controller">{{ bundle }}:{{ entity }}:update</default>
        <requirement key="_method">post</requirement>
    </route>
{% endif %}

{% if 'delete' in actions %}
    <route id="{{ route_name_prefix }}_delete" pattern="/{id}/delete">
        <default key="_controller">{{ bundle }}:{{ entity }}:delete</default>
        <requirement key="_method">post</requirement>
    </route>
{% endif %}

</routes>
