Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Use shorthand syntax for arrays in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tuupola committed Nov 5, 2014
1 parent 291188e commit a6bb41f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions README.md
Expand Up @@ -10,10 +10,10 @@ This middleware implements automatic image resizing based on image filename.

## Install

You can install latest version using [composer](https://getcomposer.org/). Middleware is still in early development.
You can install latest version using [composer](https://getcomposer.org/).

```javascript
$ composer require tuupola/slim-image-resize:dev-master
```
$ composer require tuupola/slim-image-resize
```

## Configuration
Expand All @@ -29,11 +29,11 @@ You can configure the allowed image extensions and cache folder. Cache folder mu

```php
$app = new \Slim\Slim();
$app->add(new Slim\Middleware\ImageResize(array(
"extensions" => array("jpg", "jpeg", "png", "gif"),
$app->add(new Slim\Middleware\ImageResize([
"extensions" => ["jpg", "jpeg", "png", "gif"],
"cache" => "cache",
"quality" => 90
)));
]));
```

## Caching
Expand Down Expand Up @@ -75,17 +75,17 @@ By default it is possible to create any size image. If images are also cached yo

```php
$app = new \Slim\Slim();
$app->add(new Slim\Middleware\ImageResize(array(
"sizes" => array("400x200", "x200", "200x", "100x100")
)));
$app->add(new Slim\Middleware\ImageResize([
"sizes" => ["400x200", "x200", "200x", "100x100"]
]));
```

If you have arbitary number of different sizes it is also possible to sign images with secret key.

```php
$app->add(new Slim\Middleware\ImageResize(array(
$app->add(new Slim\Middleware\ImageResize([
"secret" => "s11kr3t"
)));
]));
```

You must include the signature in the image name.
Expand Down

0 comments on commit a6bb41f

Please sign in to comment.