diff --git a/readme.md b/readme.md index 28d6a2d..d1bb914 100644 --- a/readme.md +++ b/readme.md @@ -1 +1,34 @@ -# Yocto Views Component \ No newline at end of file +# Mira Views Component +A Tiny view renderer + +# Usage + +## Basic +```php +// assumes a __DIR__/path/to/dir/view.phtml file exists + +$mira = new Mira\Mira(__DIR__ . '/path/to/views'); + +// title will be injected as variable $title +$page = $mira->render('view', ['title' => 'title']); + +// Display content however you want +echo $page; +``` + +## Insert Sections in the Template +```php +
+ insert("section"); + ?> +
+``` + +## Escape Injected parameters +```php +
+ e($title); ?> +
+``` \ No newline at end of file