Closed Jupi007 closed 2 years ago
Hi, thanks for your PR. I see a problem with this approach and i18n, though: handling mixed dynamic and static components in the label creates ambiguity as to what to do with translation of static parts. Should I treat them as translatable labels or not? In your examples, you're assuming you don't want to translate but this is not generally true for all projects.
My suggestion, when you need to do something complex like the example you provided, is to just inject BreadcrumbBuilder
in your controller and build your label dynamically there, as explained in the documentation: https://github.com/slope-it/breadcrumb-bundle#2-define-breadcrumbs
No problem, I totally understand this. Indeed, in my app, I don't need to use i18n, so I didn't think about this problematic.
I'll follow your suggestion, it's indeed more logical :+1:
Allow parsing multiple parameters and adding static string in labels:
Will render something like:
Shouldn't do any BC break.
Closes #7, #9