Commit d45d5382 authored by Andrzej Prusinowski's avatar Andrzej Prusinowski
Browse files

update docs

parent 5c00773d
## Micrus Annotations ##
This is a module for [Micrus framework](https://micrus.avris.it) that allows you to put some controller cofiguration straight inside the controllers.
This is a module for [Micrus framework](https://micrus.avris.it) that allows you
to put some controller cofiguration straight inside the controllers.
To install this module, open the file `app/Config/modules.yml` and add:
......@@ -14,24 +15,10 @@ Then run:
Generally, route definitions are put in the `app/Config/routing.yml` file, like this:
postList:
pattern: /post/list
controller: Post/list
postRead:
pattern: /post/{id}/read
controller: Post/read
requirements: { id: \d+ }
postAdd:
pattern: /post/add
controller: Post/form
postEdit:
pattern: /post/{id}/edit
controller: Post/form
requirements: { id: \d+ }
postList: /post/list -> Post/list
postRead: /post/{int:id}/read -> Post/read
postAdd: /post/add -> Post/form
postEdit: /post/{int:id}/edit -> Post/form
When this module is enabled, you could put that information directly in the controller:
......@@ -55,7 +42,7 @@ When this module is enabled, you could put that information directly in the cont
}
/**
* @M\Route("/{id}/read", requirements={"id"="\d+"})
* @M\Route("/{int:id}/read")
*/
public function readAction(Post $post)
{
......@@ -64,7 +51,7 @@ When this module is enabled, you could put that information directly in the cont
/**
* @M\Route("/add", name="postAdd")
* @M\Route("/{id}/edit", name="postEdit", requirements={"id"="\d+"})
* @M\Route("/{int:id}/edit", name="postEdit")
* @M\Secure(check="canEditPost")
*/
public function formAction(Post $post = null)
......@@ -134,3 +121,8 @@ Will become:
// ...
}
}
### Copyright ###
* **Author:** Andrzej Prusinowski [(Avris.it)](https://avris.it)
* **Licence:** [MIT](https://mit.avris.it)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment