skunkbad/php-view-loader

1.0.3 2021-12-05 06:45 UTC

This package is not auto-updated.

Last update: 2024-12-15 20:20:40 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 );