Skip to content

Commit

Permalink
Merge pull request #15 from jozan/patch-1
Browse files Browse the repository at this point in the history
Add documentation for @unless syntax
  • Loading branch information
jlambe committed Jul 22, 2015
2 parents c4fcef0 + 7e99a89 commit c7ef02a
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion views.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,22 @@ Instead of writing a ternary statement, Scout allows you to use the following co
@endif
```

##### Unless

Sometimes it is more readable to use `@unless` syntax instead of `@if`.
```html
@unless(User::current()->can('edit_posts'))
<p>No editing permission.</p>
@endunless
```

The above is same as:
```html
@if( ! User::current()->can('edit_posts'))
<p>No editing permission.</p>
@endunless
```

#### Loop statements
##### For
```html
Expand Down Expand Up @@ -550,4 +566,4 @@ Output the post classes:

Next
----
Read the [controllers guide](http://framework.themosis.com/docs/controllers/)
Read the [controllers guide](http://framework.themosis.com/docs/controllers/)

0 comments on commit c7ef02a

Please sign in to comment.