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

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

ahmetbarut/view-render
======================

A simple template engine that is lightweight and has no dependencies.

04PHP

Since Oct 10Pushed 4y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

- [PHP Simple View Engine](#php-simple-view-engine)
- [Installation and Configuration](#installation-and-configuration)
    - [Use](#use)
- [Directives](#directives)
    - [extends and yield](#extends-and-yield)
    - [section and endSection](#section-and-endsection)
    - [](#)

PHP Simple View Engine
======================

[](#php-simple-view-engine)

A simple template engine that is lightweight and has no dependencies.

Installation and Configuration
==============================

[](#installation-and-configuration)

For installation, `composer` must be installed. There is no stable version of the package yet.

```
    composer require ahmetbarut/view-render
```

Add the following configurations after the package is installed. The package needs the `cache` and `template` directories, you need to create it and specify its path.

```
    $view = new \ahmetbarut\View\Render([
        "view" => __DIR__ . "/view",
        'cache' => __DIR__ . '/cache'
    ]);
```

Use
---

[](#use)

After the configuration of the package is finished, let's first use it with a template.

Create a file in the created `template` directory.

```
    // view/home.php
    {{ $helloWorld }}
```

```
    // index.php
    require_once  "vendor/autoload.php";

    $view = new \ahmetbarut\View\Render([
        "view" => __DIR__ . "/view",
        'cache' => __DIR__ . '/cache'
    ]);

    $view->load('home', [
        "helloWorld" => "Hello World !"
    ]);
```

The `load` method loads the corresponding template.

Directives
==========

[](#directives)

Directives are uses for this template.

### extends and yield

[](#extends-and-yield)

The `extends` directive can be used to add layouts. Imagine you have a page and constantly copying the entire structure of this page causes us to write code in a very tedious and unnecessary way. In this case, the `extends` directive simplifies our work. The `yield` directive allows to fetch the sections that will change on each page.

Örnek Kullanım:

```
//layouts.php
DOCTYPE html>

    @yield('title')

@yield('content')

```

And we included our `home.php` page and included the relevant layout and pushed our page into layout.

```
// home.php
@extends('layouts')

@section('title')
Hello Template Title
@endSection

@section('content')
hello there, this is content
@endSection
```

section and endSection
----------------------

[](#section-and-endsection)

The `section` directive starts the section and the `endSection` directive ends the section and pushes it into order.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/36641723?v=4)[Ahmet Barut](/maintainers/ahmetbarut)[@ahmetbarut](https://github.com/ahmetbarut)

---

Top Contributors

[![ahmetbarut](https://avatars.githubusercontent.com/u/36641723?v=4)](https://github.com/ahmetbarut "ahmetbarut (5 commits)")

### Embed Badge

![Health badge](/badges/ahmetbarut-view-render/health.svg)

```
[![Health](https://phpackages.com/badges/ahmetbarut-view-render/health.svg)](https://phpackages.com/packages/ahmetbarut-view-render)
```

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3851.2M](/packages/limenius-react-bundle)[area17/laravel-auto-head-tags

Laravel Auto Head Tags helps you build the list of head elements for your app

4616.1k](/packages/area17-laravel-auto-head-tags)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.3k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

282.2k](/packages/webkinder-sproutset)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
