Skip to content

Commit

Permalink
Fix autowiring issue (#47)
Browse files Browse the repository at this point in the history
* Fix autowiring issue

* Add documentation
  • Loading branch information
MaximePinot authored and rvanlaak committed Sep 19, 2019
1 parent 1751b89 commit 199eae1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
</call>
</service>

<service id="%apy_breadcrumb_trail.class%" alias="apy_breadcrumb_trail" public="true"/>

<service id="apy_breadcrumb_trail.twig.extension" class="%apy_breadcrumb_trail.twig.extension.class%">
<argument type="service" id="apy_breadcrumb_trail" />
<argument type="service" id="templating" />
Expand Down
27 changes: 26 additions & 1 deletion Resources/doc/php_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Add breadcumbs to the trail with PHP in your controller.


## Basic example
## Basic example (without autowiring)

```php
/**
Expand All @@ -26,6 +26,31 @@ Will render the following breadcrumb trail :

> Level 1 > Level 2 > Level 3 > Level 4
## Basic example (with autowiring)

```php
use APY\BreadcrumbTrailBundle\BreadcrumbTrail\Trail;

/**
* @Breadcrumb("Level 1")
* @Breadcrumb("Level 2")
*/
class MyController extends Controller
{
/**
* @Breadcrumb("Level 3")
*/
public function myAction(Trail $trail)
{
$trail->add('Level 4');
}
}
```

Will render the following breadcrumb trail :

> Level 1 > Level 2 > Level 3 > Level 4
## Reference

```php
Expand Down

0 comments on commit 199eae1

Please sign in to comment.