Skip to content

Commit

Permalink
Merge branch 'master' of github.com:fenom-template/storage
Browse files Browse the repository at this point in the history
  • Loading branch information
bzick committed Dec 26, 2016
2 parents 42f8a4b + 3216872 commit 110c0a0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
Data storage for Fenom
=======

# Install

Use composer:
```json
{
"require": {
"fenom/storage": "1.*"
}
}
```

# Setup

Add traits into your Fenom class:
Add trait into your Fenom class:

```php

class MyFenom extends Fenom {
use Fenom\Storage;
class MyFenom extends \Fenom {
use \Fenom\StorageTrait;
}
```

Expand All @@ -31,4 +43,4 @@ $fenom->resetVars();
$fenom->pipe($template_name, $callback);
$fenom->fetch($template_name);
$fenom->display($template_name);
```
```
4 changes: 2 additions & 2 deletions src/Fenom/StorageTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function resetVars()
public function display($template, array $vars = array())
{
/* @var \Fenom|StorageTrait $this */
return $this->_vars = $this->getTemplate($template)->display($template, $vars ? $vars + $this->_vars : $this->_vars);
return $this->_vars = $this->getTemplate($template)->display($vars ? $vars + $this->_vars : $this->_vars);
}

/**
Expand Down Expand Up @@ -154,4 +154,4 @@ public function pipe($template, $callback, array $vars = array(), $chunk = 1e6)
ob_end_flush();
return $data;
}
}
}

0 comments on commit 110c0a0

Please sign in to comment.