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

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

midorikocak/view
================

View is the V in MVC. A small library to include in your MVC projects.

v1.0.5(6y ago)118MITPHPPHP ~7.4

Since Feb 3Pushed 6y ago1 watchersCompare

[ Source](https://github.com/midorikocak/view)[ Packagist](https://packagist.org/packages/midorikocak/view)[ Docs](https://github.com/midorikocak/view)[ RSS](/packages/midorikocak-view/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (6)Versions (5)Used By (0)

View
====

[](#view)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9df6ddd95213b551d2bafd10de0ba6553c89cb23d0e85d84628bdfe83223ca31/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d69646f72696b6f63616b2f766965772e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/midorikocak/view)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/30f5215e124538a86e83a80b1d10c7d4e19c1496899ee3fd304404add47efdfe/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d69646f72696b6f63616b2f766965772f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/midorikocak/view)[![Coverage Status](https://camo.githubusercontent.com/2883d301e5653ce6f0e4816e99f7b45ba0cc16c8448fc54490a1ace834c4eac5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6d69646f72696b6f63616b2f766965772e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/midorikocak/view/code-structure)[![Quality Score](https://camo.githubusercontent.com/0987357fb8eb816e11d765491cc74bb47aa50f2250a8ac09a097e9fac5e07267/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6d69646f72696b6f63616b2f766965772e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/midorikocak/view)[![Total Downloads](https://camo.githubusercontent.com/1efc799a5695e3cc272981ccad4a92330776d22f73beb38caf13942bf94a7c06/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d69646f72696b6f63616b2f766965772e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/midorikocak/view)

View is the V in MVC. A small library to include in your MVC projects. Allows you to separate presentation layer from the rest of your application.

**Note:** It's your responsibility to check user inputs. This library just renders templates. Nothing else.

Install
-------

[](#install)

Via Composer

```
$ composer require midorikocak/view
```

Usage
-----

[](#usage)

Let's say you have blog post data like this:

```
$articleData = [
    'title' => 'Writing object oriented software is an art.',
    'sections' => [
        [
            'title' => 'Introduction',
            'content' => [
                'Some people say that you have to be genius, or man,
        but they mostly does not undertsand what is humble programming.
        Programming should be a modest person\'s craft.',
                'Generally those people does exclude others, create clickbait articles,
            they make you feel less confident.',
                'Do not care about them and just try to create things. Learn. Be hungry.',
            ],
        ],
    ],
    'created' => '2020-01-25 00:00:00',
];
```

And you want to render an article using template like this:

```
// template.php
