Skip to content

Commit

Permalink
Rename term filter alias to filter service
Browse files Browse the repository at this point in the history
  • Loading branch information
ojhaujjwal committed Aug 22, 2014
1 parent 8238cae commit 84b3ca5
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ This module simplies image manipulation for Zend Framework 2. This module integr
* Copy the file located in `vendor/hrevert/ht-img-module/config/ht-img-module.global.php` to `config/autoload` and change the values as you wish

## Basic Usage
First, you need to create a filter alias, `my_thumbnail` in `/module/Application/config/module.config.php`
First, you need to create a filter service, `my_thumbnail` in `/module/Application/config/module.config.php`
```php
return [
'htimg' => [
'filters' => [
'my_thumbnail' => [ // this is filter aliases
'my_thumbnail' => [ // this is filter service
'type' => 'thumbnail', // this is a filter loader
'options' => [ // filter loader passes these options to a Filter which manipulates the image
'width' => 100,
Expand All @@ -44,7 +44,7 @@ Alternatively, you can:
Behind the scenes, the module applies the filter to the image on the first request and then caches the image to the web root. On the next request, the cached image would be served directly from the file system.

## Theory of Operation
Whenever, you call a filter alias like `my_thumbnail` from view template, the view helpers(htImgUrl and htDisplayImage) check if the cached image exists. If the cached image exists, it just returns the url to cached image. Else, it return the url where the image is displayed. Also a new cached image is created in the web root!
Whenever, you call a filter service like `my_thumbnail` from view template, the view helpers(htImgUrl and htDisplayImage) check if the cached image exists. If the cached image exists, it just returns the url to cached image. Else, it return the url where the image is displayed. Also a new cached image is created in the web root!

## Documentation
The officially documentation is available in the [docs/](https://github.com/hrevert/HtImgModule/tree/master/docs) directory:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Filters, Filter Loaders And Filter Aliases
Filters, Filter Loaders And Filter Services
=========================================

# Filters
Filter are classes that do the basic image manipulation operations as described [here](http://imagine.readthedocs.org/en/latest/usage/filters.html).
A filter must implement [Imagine\Filter\FilterInterface](https://github.com/avalanche123/Imagine/blob/develop/lib/Imagine/Filter/FilterInterface.php). The only required method is `apply` which does the image manipulation operation. This module comes with a lot of built in filters. See [here](https://github.com/avalanche123/Imagine/tree/develop/lib/Imagine/Filter) and [here](https://github.com/hrevert/HtImgModule/tree/master/src/Imagine/Filter).

## Filters Aliases
Filter Aliases are quick and easy way to access filters from view helpers. For example,
## Filters Services
Filter Services are quick and easy way to access filters from view helpers. For example,
```php
echo $this->htDisplayImage('relative/path/to/image', 'filter_alias');// Here it is
echo $this->htDisplayImage('relative/path/to/image', 'filter_service');// Here it is
```
## Filter Loaders
Filter Loaders loads a filter by providing the options of a filter aliases to a filter. Filter loader must implement [HtImgModule\Imagine\Filter\Loader\LoaderInterface](https://github.com/hrevert/HtImgModule/blob/master/src/Imagine/Filter/Loader/LoaderInterface.php). The only required method is `load`.
Filter Loaders loads a filter by providing the options of a filter services to a filter. Filter loader must implement [HtImgModule\Imagine\Filter\Loader\LoaderInterface](https://github.com/hrevert/HtImgModule/blob/master/src/Imagine/Filter/Loader/LoaderInterface.php). The only required method is `load`.

### Navigation

Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Welcome to the official HtImgModule documentation. This documentation will help

If you are looking for some information that is not listed in the documentation, please open an issue!

1. [Filters, Filter Loaders And Filter Aliases](Filters, Filter Loaders And Filter Aliases.md)
1. [Filters, Filter Loaders And Filter Services](Filters, Filter Loaders And Filter Services.md)
2. [Using Filters](Using Filters.md)
3. [Displaying Images From Controller](Images From Controller.md)
4. [Image Loaders](image-loaders.md)
Expand Down
6 changes: 3 additions & 3 deletions docs/Using Filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ return [
return [
'htimg' => [
'filters' => [
'crop_alias' => [
'crop_service' => [
'type' => 'crop',
'options' => [
'width' => 100,
Expand All @@ -50,7 +50,7 @@ return [
return [
'htimg' => [
'filters' => [
'resize_alias' => [
'resize_service' => [
'type' => 'resize',
'options' => [
'width' => 100,
Expand Down Expand Up @@ -174,4 +174,4 @@ return [
### Navigation

* Continue to [Displaying Images From Controller](Images From Controller.md)
* Back to [Filters, Filter Loaders And Filter Aliases](Filters, Filter Loaders And Filter Aliases.md)
* Back to [Filters, Filter Loaders And Filter Services](Filters, Filter Loaders And Filter Services.md)
2 changes: 1 addition & 1 deletion src/Imagine/Filter/FilterManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function getFilterOptions($filter)
/**
* Validates if filter exists and is valid
*
* @param string $filter Filter Alias
* @param string $filter Filter Service
* @throws Exception\FilterNotFoundException
* @throws Exception\InvalidArgumentException
* @return void
Expand Down
2 changes: 1 addition & 1 deletion src/View/Helper/DisplayImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class DisplayImage extends AbstractHtmlElement
* Gets valid HTML image tag or self when $relativeName is not provided
*
* @param string $relativeName Relative Path
* @param string $filter Filter Alias
* @param string $filter Filter Service
* @param array $attributes Attributes for HTML image tag
* @return string
*/
Expand Down
2 changes: 1 addition & 1 deletion src/View/Helper/ImgUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __construct(
* Gets url of image
*
* @param string $relativeName Relative Path
* @param string $filter Filter Alias
* @param string $filter Filter Service
* @return string
*/
public function __invoke($relativeName, $filter)
Expand Down

0 comments on commit 84b3ca5

Please sign in to comment.