-
Notifications
You must be signed in to change notification settings - Fork 68
Allow injecting the service into Controller constructor for autowiring #90
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, but we need to make that service private from now and make its alias public only
Resources/config/breadcrumbs.xml
Outdated
@@ -6,11 +6,13 @@ | |||
<services> | |||
|
|||
<!-- Our service, for controllers --> | |||
<service id="white_october_breadcrumbs" class="WhiteOctober\BreadcrumbsBundle\Model\Breadcrumbs" public="true"> | |||
<service id="WhiteOctober\BreadcrumbsBundle\Model\Breadcrumbs" class="WhiteOctober\BreadcrumbsBundle\Model\Breadcrumbs" public="true"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be private from now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, thanks
Resources/config/breadcrumbs.xml
Outdated
<call method="setRouter"> | ||
<argument type="service" id="router" /> | ||
</call> | ||
</service> | ||
<service id="white_october_breadcrumbs" alias="WhiteOctober\BreadcrumbsBundle\Model\Breadcrumbs"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should remain public
Ready for merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Cool! Can't wait for a point release ;) |
For a possible workaround, until it's merged, you can add an alias in your system so you can use it for now:
|
Thank you for this, @andrewmy. Sorry for the delay in merging. Thank you @bocharsky-bw for reviewing and approving as well - makes my job a lot easier! |
This is now in release https://github.com/whiteoctober/BreadcrumbsBundle/releases/tag/1.4.2 |
This update allows injecting the service into Controller constructor for autowiring.