KnpLabs/KnpRadBundle — pull request #129 by Djeg (2013-10-13 12:41:01+00:00)
Title: Feature/smart routing syntax

This is an introduction of a new rad routing syntax. We have discuss it with @docteurklein. So, in order to activate this new routing syntax just turn off the older one in the `config.yml` :

```yaml
knp_rad:
routing_loader:
old: false
```

By default the older system is activated. So no compatibility break.

This is a short sample of the new syntax :

```yaml
# default routing support
default_syntax:
pattern: '/default'

# complete rad routing. Generate :
# some_rad_resource_index [GET] /tests
# some_rad_resource_new [GET] /tests/new
# some_rad_resource_create [POST] /tests
# some_rad_resource_show [GET] /tests/{Test_id}
# some_rad_resource_edit [GET] /tests/{Test_id}/edit
# some_rad_resource_update [PUT|PATCH] /tests/{Test_id}
# some_rad_resource_delete [DELETE] /tests/{Test_id}
@some_rad_resource:
resource: App:Test
property: 'id'
actions: ~

# some shotcuts
@App:Test: ~

# parent resource support. Generate :
# app_child_index [GET] /tests/{Test_id}/children
# app_child_new [GET] /tests/{Test_id}/children/new
# app_child_create [POST] /tests/{Test_id}/children
# app_child_show [GET] /tests/{Test_id}/children/{Child_slug}
# app_child_update [PUT|PATCH] /tests/{Test_id}/children/{Child_slug}
# app_child_delete [DELETE] /tests/{Test_id}/children/{Child_slug}
@App:Child:
parent: some_rad_resource
property: 'slug'
actions: ~

# defined custom actions. Generate :
# app_foo_custom [GET] /custom
# app_foo_index [GET] /foos
@App:Foo:
actions:
custom:
pattern: '/custom'
methods: GET
index: ~
```