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

Commit

Permalink
Merge pull request #285 from mtymek/patch-2
Browse files Browse the repository at this point in the history
Update base path cookbook
  • Loading branch information
weierophinney committed Jan 27, 2016
2 parents a1dfa80 + 78cf145 commit 65a96bf
Showing 1 changed file with 3 additions and 23 deletions.
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 65a96bf

Please sign in to comment.