Fenom extension. Store data in Fenom
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/Fenom
tests/Fenom
.gitignore
README.md
authors.md
composer.json
phpunit.xml.dist

README.md

Data storage for Fenom

Install

Use composer:

{  
    "require": {
        "fenom/storage": "1.*"
    }
}

Setup

Add trait into your Fenom class:


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

Use

// set variable
$fenom->assign("var_name", $value);
// set variable by references
$fenom->assignByRef("var_name", $value);
// append variable to tail of array 'var_name'
$fenom->append("var_name", $value);
// prepend variable to head of array 'var_name'
$fenom->prepend("var_name", $value);
$vars = $fenom->getVars();
// set all variables as single array (rewrite previous array)
$fenom->assignAll($vars);
// remove all variables
$fenom->resetVars();

$fenom->pipe($template_name, $callback);
$fenom->fetch($template_name);
$fenom->display($template_name);