Skip to content

Commit

Permalink
Add line *.lock to .gitignore file, to prevent *.lock files uploaded
Browse files Browse the repository at this point in the history
to repository.

Update README.md files add Instalation and Sample Usage section
  • Loading branch information
nariyanto committed May 6, 2017
1 parent 63f7d98 commit 8a1cc63
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*.conf
*.ini
*.bak
*.lock

/vendor/
/docs/
Expand Down
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,55 @@ Use other full-blown templating engines for rendering complex dynamic HTML.

----

## Installation

Install it from Packagist:

```bash
$ composer -vvv require bfitech/zaplate
```

## Sample Usage

# template.php
```php
<p><?php echo $group ?></p>
<ul>
<?php foreach ($members as $member); ?>
<li><?php echo $member ?></li>
<?php enforeach; ?>
</ul>
```

# renderer.php
```php
class Filter {
public function whoami($name) {
if (is_string($name))
return $name;
return array_map(function($iname){
if (strpos(strtolower($iname), 'jekyll') !== false)
return 'Mr Hyde';
return $iname;
}, $name);
}
}
```

```php
(new Template())->load('template.php', [
'group' => "Extraordinary Gents",
'members' => [
'Allan Quatermain',
'Henry Jekyll',
], [
[(new Filter()), 'whoami']
]
]);
```

## Documentation

Documentation available with:

```txt
Expand Down

0 comments on commit 8a1cc63

Please sign in to comment.