PHPackages                             crhayes/scenic-view - 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. crhayes/scenic-view

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

crhayes/scenic-view
===================

Fast and simple view inheritance and templating.

6431PHP

Since May 10Pushed 13y ago2 watchersCompare

[ Source](https://github.com/crhayes/scenic-view)[ Packagist](https://packagist.org/packages/crhayes/scenic-view)[ RSS](/packages/crhayes-scenic-view/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Scenic View
===========

[](#scenic-view)

Scenic View is a tiny library that provides view and template inheritance. The syntax is straight PHP but is very clean and expressive.

The following examples use PHP short syntax (to provide cleaner views) which is fine if you have control over your own server. **NOTE:** you should definitely use ``if you are planning to distribute your code or do not have admin access to your server.

Loading and Rendering a View
----------------------------

[](#loading-and-rendering-a-view)

```
$view = new Scenic\View('path/to/views');

echo $view->render('index.php', array('title' => 'Welcome', 'name' => 'Chris'));
```

View Inheritance and Templating
-------------------------------

[](#view-inheritance-and-templating)

### Layouts

[](#layouts)

Create a layout (template) file that other files will extend. The `$show()` method displays a section of content that's defined by a child view extending it.

```
