skunkbad/php-view-loader

View Loader for PHP

Installs: 71

Dependents: 0

Suggesters: 0

Security: 0

pkg:composer/skunkbad/php-view-loader

1.0.3 2021-12-05 06:45 UTC

This package is not auto-updated.

Last update: 2025-10-06 00:03:47 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 );