merophp/xml-view

XML view plugin for merophp/view-engine

0.1-alpha 2021-12-21 17:44 UTC

This package is auto-updated.

Last update: 2024-11-22 18:13:59 UTC


README

XML view plugin for merophp/view-engine.

Installation

Via composer:

composer require merophp/xml-view

Basic Usage

require_once 'vendor/autoload.php';

use Merophp\XmlViewPlugin\XmlView;

use Merophp\ViewEngine\ViewEngine;
use Merophp\ViewEngine\ViewPlugin\Collection\ViewPluginCollection;
use Merophp\ViewEngine\ViewPlugin\Provider\ViewPluginProvider;
use Merophp\ViewEngine\ViewPlugin\ViewPlugin;

$collection = new ViewPluginCollection();
$collection->add(
    new ViewPlugin(XmlView::class),
]);

$provider = new ViewPluginProvider($collection);

$viewEngine = new ViewEngine($provider);

$view = $viewEngine->initializeView();
$view->xml('Hello world');
echo $viewEngine->renderView($view);