Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README update: source img outside web root #45

Merged
merged 1 commit into from
Jan 10, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,29 @@ liip_imagine:
For an example of a filter loader implementation, refer to
`Liip\ImagineBundle\Imagine\Filter\Loader\ThumbnailFilterLoader`.

## Outside the web root

When your setup requires your source images to live outside the web root, or if that's just the way you roll,
you can override the DataLoader service and define a custom path, as the third argument, that replaces
`%liip_imagine.web_root%` (example here in XML):

``` xml
<service id="liip_imagine.data.loader.filesystem" class="%liip_imagine.data.loader.filesystem.class%">
<tag name="liip_imagine.data.loader" loader="filesystem" />
<argument type="service" id="liip_imagine" />
<argument>%liip_imagine.formats%</argument>
<argument>%kernel.root_dir%/data/uploads</argument>
</service>
```

One way to override a service is by redefining it in the services configuration file of your bundle.
Another way would be by modifying the service definition from your bundle's Dependency Injection Extension:

``` php
$container->getDefinition('liip_imagine.data.loader.filesystem')
->replaceArgument(2, '%kernel.root_dir%/data/uploads');
```

## Custom image loaders

The ImagineBundle allows you to add your custom image loader classes. The only
Expand Down