merophp / text-view
Text view plugin for merophp/view-engine
0.1-alpha
2021-12-22 11:43 UTC
Requires
- php: >=7.4
- merophp/view-engine: 0.1-alpha
Requires (Dev)
- phpunit/phpunit: ^9.5
README
Simple text view plugin for merophp/view-engine.
Installation
Via composer:
composer require merophp/text-view
Basic Usage
require_once 'vendor/autoload.php';
use Merophp\TextViewPlugin\TextView;
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(TextView::class),
]);
$provider = new ViewPluginProvider($collection);
$viewEngine = new ViewEngine($provider);
$view = $viewEngine->initializeView();
$view->text('Hello world');
echo $viewEngine->renderView($view);