Skip to content

Commit 2e3e6f6

Browse files
committed
Update README
Signed-off-by: Fery Wardiyanto <[email protected]>
1 parent 52be00d commit 2e3e6f6

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@ $container->register(new \Projek\Slim\PlatesProvider);
2929

3030
// Option 2, using Closure
3131
$container['view'] = function ($c) {
32-
$view = new \Projek\Slim\Plates([
32+
$settings = [
33+
// Path to view directory
3334
'directory' => 'path/to/views',
35+
// Path to asset directory
3436
'assetPath' => 'path/to/static/assets',
37+
// Template extension (default: 'php')
3538
'fileExtension' => 'tpl',
36-
]);
39+
];
40+
$view = new \Projek\Slim\Plates($settings);
3741

3842
// Instantiate and add Slim specific extension
3943
$view->loadExtension(
@@ -54,13 +58,13 @@ $app->get('/hello/{name}', function ($request, $response, $args) {
5458
$app->run();
5559
```
5660

57-
**NOTE**: if you are using _option 1_ please make sure you already have `$container['settings']['plates']` in your configuration file.
61+
**NOTE**: if you are using _option 1_ please make sure you already have `$container['settings']['view']` in your configuration file.
5862

5963
## Custom template functions
6064

6165
This component exposes a custom `$this->pathFor()` function to your Plates templates. You can use this function to generate complete URLs to any Slim application named route. This is an example Plates template:
6266

63-
```html
67+
```php
6468
<?php $this->layout('base-template') ?>
6569

6670
<?php $this->start('body') ?>
@@ -82,7 +86,8 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
8286
## Credits
8387

8488
- [Fery Wardiyanto](http://feryardiant.me)
85-
- [Slim Framework](http://www.slimframework.com/)
89+
- [Slim Framework](http://www.slimframework.com)
90+
- [Plates Template](http://platesphp.com)
8691

8792
## License
8893

0 commit comments

Comments
 (0)