Multi Platform Template System is a template engine for PHP and other platforms.

Installs: 1 329

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/mkrawczyk/mpts

v1.4.3 2024-12-20 15:51 UTC

README

Official website: https://greencodestudio.github.io/mpts/

Usage in code

PHP

# Install the MPTS library using Composer
composer require mkrawczyk/mpts
// Import necessary classes from the MPTS library
use MKrawczyk\Mpts\Environment;
use MKrawczyk\Mpts\Parser\XMLParser;

// Parse the MPTS template file
$template = XMLParser::Parse(file_get_contents(__DIR__ . '/file.mpts'));

// Create a new environment and set variables
$env = new Environment();
$env->variables = ['foo' => 'bar'];

// Execute the template with the environment and output the result
echo $template->executeToString($env);