PHPackages                             cesarv/views - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. cesarv/views

ActiveLibrary[Templating &amp; Views](/categories/templating)

cesarv/views
============

Simple View Renderer

v1.0.0(11y ago)0681MITPHP

Since Apr 1Pushed 11y ago1 watchersCompare

[ Source](https://github.com/cesar-v/views)[ Packagist](https://packagist.org/packages/cesarv/views)[ Docs](https://github.com/cesar-v/views)[ RSS](/packages/cesarv-views/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (1)

Views
=====

[](#views)

A simple view renderer - will read a .phtml file from the directory passed to the views.dir option, bind variables to it, and return the content as a string.

NO HEAVY TEMPLATE ENGINE! - PHP does templating on it's own, remember?

Options
-------

[](#options)

The following options are avaliable during object construction:

OptionDescriptionRequiredviews.dirRoot path of your views directory.YesUsage
-----

[](#usage)

Consider the following directory structure:

```
app/
├── index.php
├── vendor
│   └── autoload.php
└── views
    └── Hello.phtml

```

Hello.phtml contains the following:

```

        Hello

        Hello

```

This is how we render our view from index.php:

```
