public function setUp() { $slice = new \PHPixie\Slice(); $filesystem = new \PHPixie\Filesystem(); $locatorConfig = $slice->arrayData(array('directory' => 'assets/layout')); $templateConfig = $slice->arrayData(array()); $root = $filesystem->root(dirname(dirname(dirname(__DIR__)))); $locator = $filesystem->buildlocator($locatorConfig, $root); $template = new \PHPixie\Template($slice, $locator, $templateConfig); $this->toolbar = new \Meling\Toolbar($template); }
public function setUp() { $slice = new \PHPixie\Slice(); $filesystem = new \PHPixie\Filesystem(); $locatorConfig = $slice->arrayData(array('directory' => '/layout/')); $templateConfig = $slice->arrayData(array()); $root = $filesystem->root(__DIR__); $locator = $filesystem->buildlocator($locatorConfig, $root); $template = new \PHPixie\Template($slice, $locator, $templateConfig); $builder = new \Meling\Toolbar\Builder($template); $this->buttons = new \Meling\Toolbar\Buttons($builder); }
<?php require_once 'vendor/autoload.php'; //Required libraries $slice = new \PHPixie\Slice(); $filesystem = new \PHPixie\Filesystem(); //Configuration $locatorConfig = $slice->arrayData(array('directory' => '/templates/')); $templateConfig = $slice->arrayData(array()); //Build dependencies $root = $filesystem->root(__DIR__); $locator = $filesystem->buildlocator($locatorConfig, $root); //And the Template library itself $template = new \PHPixie\Template($slice, $locator, $templateConfig); echo $template->render('fairy', array('name' => 'Stella')); $fairy = $template->get('fairy'); $fairy->name = 'Blum'; echo $fairy->render();