Skip to content

Commit

Permalink
style: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Nov 11, 2021
1 parent e631751 commit 9b5bc88
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,14 @@ You can use the filters in any of your templates.
**Regular usage**:

```php
{{ 'john' | ucfirst }} // John
{{ 'inhere' | ucfirst }} // Inhere
{{ 'inhere' | upper }} // INHERE
```

**Chained usage**:

```php
{{ 'john' | ucfirst | substr:0,1 }} // J
{{ 'inhere' | ucfirst | substr:0,2 }} // In
{{ '1999-12-31' | date:'Y/m/d' }} // 1999/12/31
```

Expand All @@ -128,7 +129,7 @@ You can use the filters in any of your templates.
{{ $name | ucfirst | substr:0,1 }}
{{ $user['name'] | ucfirst | substr:0,1 }}
{{ $userObj->name | ucfirst | substr:0,1 }}
{{ getName() | ucfirst | substr:0,1 }}
{{ $userObj->getName() | ucfirst | substr:0,1 }}
```

**Passing variables as filter parameters**:
Expand Down Expand Up @@ -165,9 +166,9 @@ Use in template:
$name = 'inhere';
}}

{{ $name | upper }} // Output: INHERE
{{ $name | last3chars }} // Output: ere
{{ $name | last3chars | upper }} // Output: ERE
{{ $name | upper }} // INHERE
{{ $name | last3chars }} // ere
{{ $name | last3chars | upper }} // ERE
```

## Custom directives
Expand Down

0 comments on commit 9b5bc88

Please sign in to comment.