skunkbad/php-view-loader

1.0.2 2019-01-27 08:40 UTC

This package is not auto-updated.

Last update: 2020-10-19 13:17:46 UTC


README

This package allows for loading traditional PHP views without any dependencies.

Simple Example:

<?php
// Loads a view named page-content.php and passes 
// in the current user, available as $currentUser.
$view = new \Skunkbad\ViewLoader\View;
$view->addPath( __DIR__ . '/views/' );
$view->load('page-content', [
	'currentUser' => $currentUser
]);

Return the same view, instead of outputting it:

<?php
$str = $view->load('page-content', [
	'currentUser' => $currentUser
], TRUE );