diff --git a/CHANGELOG.md b/CHANGELOG.md index dea992b8..8cd47c12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,9 @@ Initial stable release. references to the `PlatesRenderer` in the error handling documentation. - [#284](https://github.com/zendframework/zend-expressive/pull/284) fixes the reference to maximebf/php-debugbar in the debug bar documentation. +- [#285](https://github.com/zendframework/zend-expressive/pull/285) updates + the section on mtymek/blast-base-url in the "Using a Base Path" cookbook + recipe to conform to its latest release. ## 1.0.0rc7 - 2016-01-21 diff --git a/doc/book/cookbook/using-a-base-path.md b/doc/book/cookbook/using-a-base-path.md index 05810afa..5ef5e40c 100644 --- a/doc/book/cookbook/using-a-base-path.md +++ b/doc/book/cookbook/using-a-base-path.md @@ -90,7 +90,7 @@ configuration. To install it: ```bash -$ composer require "mtymek/blast-base-url:dev-master@dev" +$ composer require mtymek/blast-base-url ``` To configure it, update the file `config/autoload/middleware-pipeline.global.php`, @@ -127,9 +127,8 @@ the request URI and the operating system path to the application. The primary advantage of `mtymek/blast-base-url` is in its additional features: -- it provides an override of `Zend\Expressive\Helper\UrlHelper` that is aware of - the base path, allowing you to create route-based URLs relative to the base - path. +- it injects `Zend\Expressive\Helper\UrlHelper` with the base path, allowing you + to create relative route-based URLs. - it provides a new helper, `Blast\BaseUrl\BasePathHelper`, which allows you to create URLs relative to the base path; this is particularly useful for assets. @@ -143,29 +142,10 @@ return [ Blast\BaseUrl\BasePathHelper::class => Blast\BaseUrl\BasePathHelper::class, /* ... */ ], - 'factories' => [ - Blast\BaseUrl\UrlHelper::class => Blast\BaseUrl\UrlHelperFactory::class, - /* ... */ - ], - 'aliases' => [ - // alias default UrlHelper with Blast\BaseUrl alternative - Helper\UrlHelper::class => Blast\BaseUrl\UrlHelper::class, - /* ... */ - ], ], ]; ``` -Additionally, remove the following from the same file: - -```php - 'factories' => [ - // Remove the following line only: - Helper\UrlHelper::class => Helper\UrlHelperFactory::class, - /* ... */ - ], -``` - Finally, if you're using zend-view, you can register a new "basePath" helper in your `config/autoload/templates.global.php`: