Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tylersriver committed Dec 25, 2021
1 parent 2c2a008 commit 7c9a1c8
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1 +1,34 @@
# Yocto Views Component
# 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
<div>
<?php
// render a section in the view
$this->insert("section");
?>
</div>
```

## Escape Injected parameters
```php
<div>
<?php echo $this->e($title); ?>
</div>
```

0 comments on commit 7c9a1c8

Please sign in to comment.