-
Notifications
You must be signed in to change notification settings - Fork 68
Add Annotation Support #35
Comments
Sorry for the late reply - I'd definitely be up for that :-) |
heh, is this your subtle way of asking for a PR? |
PRs are always welcome :-) |
Just a heads up - annotation support would be really cool, if someone is up to building it. ;) |
👍 I could take a look if I get some time. |
@aequasi @richsage @MatissJanis Have you annotation configuration samples of what you are wondering? |
@soullivaneuh Sounds great, I think it will be nice to have such behaviour like: use WhiteOctober\BreadcrumbsBundle\Annotation\BreadcrumbsAnnotation as Breadcrumb;
/**
* @Breadcrumb\Item('Home', url='/')
* @Breadcrumb\RouteItem('Blog', route={name='post'})
*/
class PostController() {
/**
* @Breadcrumb\RouteItem('{post.name}', route={name='post_show', parameters={'id': '{post.id}'}})
*/
public function showAction(Post $post)
{
// action code here...
}
} in result we will have: Home > Blog > The post name What do you think? |
A single annotation would probably be easier /**
* @Breadcrumb('Home', url='/')
* @Breadcrumb('Blog', route={name='post'})
*/
class PostController() {
/**
* @Breadcrumb('{post.name}', route={name='post_show', parameters={'id': '{post.id}'}})
*/
public function showAction(Post $post)
{
// action code here...
}
} |
I'd probably prefer @aequasi's version - a single annotation. Unless it gets a bit too unwieldy with large amounts of configuration options in the annotation. @bocharsky-bw what were your thoughts behind separate ones (aside from the URL and route differences)? |
@richsage I have maintained the current application architecture only. We have I think a single annotation is a bit overload, but @aequasi is right, it will be more easy to use and most probably it will be better in this case. |
Both approach has good argument. I prefer @aequasi too. I'll try it and see if it's possible. |
Using expression language may help. Dunno, just a remember note. http://symfony.com/doc/current/components/expression_language/introduction.html |
@soullivaneuh I think symfony's expression language will be useful in this case 👍 |
Found the Abhoryo/APYBreadcrumbTrailBundle having Annotation support, maybe @Abhoryo can tell or that bundle still is maintained? It does exactly what #35 (comment) does suggest. Especially the integration with |
appreciate to do this! :) |
Would be really cool to specify breadcrumbs via annotations :)
Idk if this makes sense to you, but a discussion would be nice
The text was updated successfully, but these errors were encountered: