Skip to content

Commit

Permalink
fix templates & small update
Browse files Browse the repository at this point in the history
  • Loading branch information
pafnuty committed Jun 3, 2015
1 parent c63621f commit 5cadded
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 8 deletions.
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ In the require key of composer.json file add the following
"pafnuty/laravel-fenom": "dev-master"
```

Run the Composer update comand
Run the Composer update command
```
$ composer update
```

Run command
```
$ php artisan clear-compiled
```

In your **config/app.php** add `'Pafnuty\Fenom\FenomViewServiceProvider',` to the end of the `providers` array and comment the `'Illuminate\View\ViewServiceProvider'` provider. Like this:
In your **config/app.php** add `'Pafnuty\Fenom\FenomViewServiceProvider',` to the end of the `providers` array **and comment** the `'Illuminate\View\ViewServiceProvider'` provider.
Like this:

```php
'providers' => [
Expand Down Expand Up @@ -109,6 +115,24 @@ home-text
{* This comment will not be in the rendered HTML *}
```

### Errors
```
{set $errors = $.errors}
{if $errors->any()}
{foreach $errors->all() as $error}
{$error}
{/foreach}
{/if}
```

### App
```
{set $App = $.app}
{$App::someMethodName()}
```

More usage examples can be found on the Fenom documentation pages
- [English docs](https://github.com/fenom-template/fenom/blob/master/docs/en/readme.md)
- [Russian docs](https://github.com/fenom-template/fenom/blob/master/docs/ru/readme.md)
Expand Down
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
"description": "Fenom Template Engine for Laravel 5",
"keywords": ["laravel", "fenom", "template", "view"],
"authors": [
{
"name": "Max Kostjukevich",
"email": "[email protected]"
},
{
"name": "Pavel Belousov",
"email": "[email protected]"
},
{
"name": "Max Kostjukevich",
"email": "[email protected]"
"name": "Ivan Shalganov",
"email": "[email protected]"
}
],
"license": "MIT",
Expand Down
10 changes: 6 additions & 4 deletions src/views/fenom/auth/errors.tpl
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{* {if $errors|length}
https://github.com/fenom-template/fenom/blob/master/docs/en/mods/length.md
{set $errors = $.errors}

{if $errors->any()}
{* https://github.com/fenom-template/fenom/blob/master/docs/en/mods/length.md *}
<div class="alert alert-danger">
<strong>Whoops!</strong> There were some problems with your input.<br><br>
<ul>
{foreach $errors->all() as $error}
https://github.com/fenom-template/fenom/blob/master/docs/en/tags/foreach.md
{* https://github.com/fenom-template/fenom/blob/master/docs/en/tags/foreach.md *}
<li>{$error}</li>
{/foreach}
</ul>
</div>
{/if} *}
{/if}

0 comments on commit 5cadded

Please sign in to comment.