diff --git a/Resources/config/services.xml b/Resources/config/services.xml index 9ec967d..2f87913 100644 --- a/Resources/config/services.xml +++ b/Resources/config/services.xml @@ -18,6 +18,8 @@ + + diff --git a/Resources/doc/php_configuration.md b/Resources/doc/php_configuration.md index 8f9e2a4..e438fe0 100644 --- a/Resources/doc/php_configuration.md +++ b/Resources/doc/php_configuration.md @@ -3,7 +3,7 @@ Add breadcumbs to the trail with PHP in your controller. -## Basic example +## Basic example (without autowiring) ```php /** @@ -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