AP Twig Bridge makes it possible to create templates for WordPress using Twig template engine.
Author: | Denis Voytyuk (profile at wordpress.org) |
WordPress version required: | 3.3 |
WordPress version tested: | 3.3.2 |
Plugin version: | 1.0 |
Added to WordPress repository: | 25-12-2011 |
Last updated: | 25-12-2011
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
|
Rating, %: | 0 |
Rated by: | 0 |
Plugin URI: | http://artprima.cz/ |
Total downloads: | 1 604 |
Active installs: | 10+ |
Click to start download
|
AP Twig Bridge is a bridge between WordPress and Twig. WordPress is a great system mainly because of its simplicity,
but it is a headache to create templates for it. PHP-mess is not good for creating templates, that's why
there are different template engines. Twig is a new powerful template engine developed by Fabien Potencier.
It has very clear and simple syntax, inspired by Django and Jinja. So, if you ever thought of using some templating engine in WordPress, try this plugin.
For now this plugin has a limited support for WordPress API, but I'm going to develop it further.
Your Feedback Matters
Bugs to report? Feature requests? Criticism? New ideas? We want to hear from
you! Do not hesitate. Get in touch with us and share your views.
FAQ
What PHP version does this plugin support?
This plugin should support php > 5.3.0, but is tested only on php 5.3.8.
How do I start creating my theme?
You can directly edit files in twigbridge theme folder (don’t forget to copy it to you wp-content/themes
directory). You can use functions.php to add some hooks or to load text domain.
You must have at least these files: style.css, index.php (must contain php-code to display the template, please check the example), header.php, footer.php, searchform.php.
All twig files must be in wp-content/themes/yourthemefolder/Twig
. At least index.html.twig
must exist.
How do I create a special template for a page?
Check please links.php
and archives.php
about how the php-file should look like. Create a similar file with the name you want (e.g. special.php). Then
you just create a special.html.twig
file and write all the code you need there.
Your plugin lacks some WordPress functions. How can I add them?
Yes, I know, that I didn’t include many WordPress API function, because initially this plugin was just a proff of concept. Actually, you can add the functions you need
to APBridge_TwigExtension module yourself, but your changes will be overwritten next time you update the plugin to a new version. So, creating your own extension
will be the best way to add the functions you need. You can do it in index.php
this way: $twigBridge->getTwig()->addExtension(new YourExtensionClass())
.
It must be called befor template rendering, of course. You can use APBridge_TwigExtension
class as an example. Also you can write to me about the functions you need,
so that I could include them in future versions.
Is there an easy way to contact the developer of this plugin?
Of course there is. Visit ArtPrima.cz in order to find our e-mail address and other contacts.
ChangeLog