Skip to content

Commit

Permalink
Merge pull request #26 from rvanbaalen/patch-1
Browse files Browse the repository at this point in the history
Added chrome-extension example
  • Loading branch information
bakura10 committed Sep 30, 2014
2 parents 1b03e95 + cbf0697 commit 54877f1
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,19 @@ ZfrCors only allows to accept or refuse a cross-origin request.

Internally, ZfrCors uses `Zend\Uri\UriFactory` class. If you are using custom schemes (for instance if you are
testing your API with some Google Chrome extensions), you need to add support for those schemes by adding them to
the `UriFactory` config (please [refer to the doc](http://framework.zend.com/manual/2.2/en/modules/zend.uri.html#creating-a-new-custom-class-uri).
the `UriFactory` config (please [refer to the doc](http://framework.zend.com/manual/2.2/en/modules/zend.uri.html#creating-a-new-custom-class-uri)).

### Example
To register the `chrome-extension` custom scheme in your API, simply add:

```php
UriFactory::registerScheme('chrome-extension', 'Zend\Uri\Uri');
```

to the `onBootstrap()` method in `module/Application/Module.php`. Do note that, if your IDE doesn't resolve this automatically, you should add the following `use` definition to the same file:

```php
use Zend\Uri\UriFactory;
```

Registering the `chrome-extension` custom scheme like this allows you to use Google Chrome extensions for testing your API.

0 comments on commit 54877f1

Please sign in to comment.