Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/285' into develop
Browse files Browse the repository at this point in the history
Forward port #285
  • Loading branch information
weierophinney committed Jan 27, 2016
2 parents e60be25 + ac7e891 commit 51ef9dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 23 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,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

Expand Down
26 changes: 3 additions & 23 deletions doc/book/cookbook/using-a-base-path.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down Expand Up @@ -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.

Expand All @@ -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`:

Expand Down

0 comments on commit 51ef9dd

Please sign in to comment.