Rila is a data-oriented framework for WordPress with rapid front-end development in mind. It includes a set of lot of lightweight and highly extendable class wrappers, which let you structure you code properly in a MVC-like manner.
Your single.php (controller) file:
rila_view( 'single' )->render();
Your single.twig (view) file:
{% extends "base.twig" %}
{% block content %}
<h1>{{ post.title }}</h1>
<p class="entry-meta">Posted on {{ post.date }} at {{ post.date.time }} by {{ post.author.name }}</p>
<div class="rte">
{{ post.content }}
</div>
{% if post.categories %}
<p>Belongs to {{ post.categories }}</p>
{% endif %}
{% endblock %}
Beautiful, isn't it?
composer install
within the plugin's folderThe concept of data mapping allows you to have consistent and predictable properties for item attributes, meta and more. As an example from within the framework, you could have a definition like this:
$this->translate(array(
'image' => '_thumbnail_id'
));
$this->map(array(
'_thumbnail_id' => 'image'
));
That code allows you you to use post.image
instead of post._thumbnail_id
and the value would be an actual image object, so you can go ahead and simply use this within your templates:
{{ post.image }}
Mapping does not only apply to simple objects though - it's being heavily used throughout the whole plugin. You can read more about the topic in the wiki.
All of the functionality of the plugin is described in the Wiki.
The framwork is being developed by me, Radoslav Georgiev, web developer at DigitalWerk.
Contributions and pull requests are welcome ;)