Skip to content
Snippets Groups Projects
Unverified Commit 03c15b97 authored by Thomas Flori's avatar Thomas Flori
Browse files

write something to the readme

parent fcb6c458
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,31 @@
[![Total Downloads](https://poser.pugx.org/tflori/syna/downloads.svg)](https://packagist.org/packages/tflori/syna)
[![License](https://poser.pugx.org/tflori/syna/license.svg)](https://packagist.org/packages/tflori/syna)
PHP library for rendering native php templates with sections, inheritance and helpers.
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
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
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
### Extending Views
## Installation
......
......@@ -9,6 +9,11 @@ abstract class AbstractViewHelper implements ViewHelperInterface
{
protected $view;
public function __call($name, $arguments)
{
return $this->view->__call($name, $arguments);
}
public function setView(View $view)
{
$this->view = $view;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment