PHPackages                             tflori/syna - 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. tflori/syna

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

tflori/syna
===========

Library for rendering native php templates

v1.1.1(4y ago)21.2kMITPHPPHP ^7.1 || ^8.0

Since Nov 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/tflori/syna)[ Packagist](https://packagist.org/packages/tflori/syna)[ RSS](/packages/tflori-syna/feed)WikiDiscussions master Synced yesterday

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

tflori/syna
===========

[](#tflorisyna)

[![.github/workflows/push.yml](https://github.com/tflori/syna/actions/workflows/push.yml/badge.svg)](https://github.com/tflori/syna/actions/workflows/push.yml)[![Test Coverage](https://camo.githubusercontent.com/4e261ab903a5878826688faaca31047204325d6e5fd8205b548470125a40f0a6/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f66636533613532633531633065663537663565372f746573745f636f766572616765)](https://codeclimate.com/github/tflori/syna/test_coverage)[![Maintainability](https://camo.githubusercontent.com/04e8afa425530e55a438db7c760820a07751aafbca2d9e43baba70e72189bcdf/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f66636533613532633531633065663537663565372f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/tflori/syna/maintainability)[![Latest Stable Version](https://camo.githubusercontent.com/cd6e9e7a5338a4ac94a304e368116d4da2121df61afc7399900f28353de8b61e/687474703a2f2f706f7365722e707567782e6f72672f74666c6f72692f73796e612f76)](https://packagist.org/packages/tflori/syna)[![Total Downloads](https://camo.githubusercontent.com/db11e6d4d1210d1d923dc7ff579d5b3b7a7071c44820415b62a0a8e5580b0be3/687474703a2f2f706f7365722e707567782e6f72672f74666c6f72692f73796e612f646f776e6c6f616473)](https://packagist.org/packages/tflori/syna)[![License](https://camo.githubusercontent.com/b63659ab9cefa89ca48c51fcda44d8777e22377cc54dce1d9d913b1d10ce912f/687474703a2f2f706f7365722e707567782e6f72672f74666c6f72692f73796e612f6c6963656e7365)](https://packagist.org/packages/tflori/syna)

PHP library for rendering native php templates with sections, inheritance and helpers.

This library is inspired by [aura/view](https://packagist.org/packages/aura/view) and [league/plates](https://packagist.org/packages/league/plates). Both have advantages against each other and both are lacking some major features.

> Að sýna means to show in Icelandic.

### Helpers

[](#helpers)

Both libraries are missing a functionality to not register each helper. Syna has the ability to register namespaces where your helpers are placed. Adding the namespace `App\ViewHelper` would load `App\ViewHelper\Date` for `$view->date()`.

### Layouts

[](#layouts)

Syna also provides the ability to use layouts as described by the TwoStepView pattern. Other then extending views from inside a view (suggested by other libraries like league/plates, illuminate/blade etc.) you should define the layout in your controller. The separation of concerns between extending views and wrapping a html snipped into another one is logic that should not be decided from views (e. g. loading the content of a modal dialog or loading a full page with navigation, header and footer).

### Named Locators

[](#named-locators)

### Extending Views

[](#extending-views)

Installation
------------

[](#installation)

Like all my libraries: only with composer

```
$ composer require tflori/syna
```

Basic usage
-----------

[](#basic-usage)

```
