Blade
Brings Laravel's great template engine, Blade, to Wordpress. Just install and start using blade in your theme.
The facts
- Rating
- 4★ from 7
- Active installs
- 200+
- Price
- Free
- Last updated
- 1 Dec 2015
- Added
- Jun 2013
- Requires WP
- 3.0.0
- Tested up to
- WP 3.9.40
- Downloads
- 7,574
Our analysis
AI-assistedBlade is a WordPress plugin that integrates the Blade template engine, originally developed for Laravel, into WordPress. It allows you to create cleaner template files and speeds up development by using a templating syntax that simplifies PHP code. The plugin also includes WordPress-specific snippets to enhance functionality.
This plugin is suitable for developers familiar with Laravel who want to apply similar templating techniques in their WordPress projects. It can be particularly useful for those looking to streamline their code and improve template management.
Best for: This plugin suits developers familiar with Laravel who want to use Blade in WordPress.
What it does well
- ✓Integrates Blade template engine into WordPress
- ✓Enables cleaner template files
- ✓Supports WordPress-specific snippets
- ✓Allows use of normal PHP code
Where it falls short
- •Last updated in December 2015
- •Tested up to WordPress version 3.9.40
- •Limited information on features and usage examples
Verdict
Blade offers a way to implement a popular templating engine in WordPress, but its outdated status may limit compatibility with newer WordPress versions.
From the developer
Mikael Mattsson's own description of Blade, lightly tidied.
Blade is the template engine for Laravel, a very popular php framework, developed by Taylor Otwell. This plugin brings the same template engine to wordpress.
Using a template engine will result in much cleaner template files and quicker development. Normal php can still be used in the template files.
The plugin also adds a wordpress specific snippet to blade. Check out the examples for more info.
echo/print
{{$foo}}
Turns into…
if()
@if(has_post_thumbnail())
{{the_post_thumbnail() }}
@else
<img src="{{bloginfo( 'template_url' )}}/images/thumbnail-default.jpg" />
@endif
Turns into…
the loop
@wpposts
<a href="{{the_permalink()}}">{{the_title()}}</a><br>
@wpempty
<p>404</p>
@wpend
Turns into…
Advanced Custom Fields
<ul>
@acfrepeater('images')
<li>{{ get_sub_field( 'image' ) }}</li>
@acfend
</ul>
Turns into…
Including other templates
To include a file with blade use:
@include(‘header’)
Note that you should not type “.php”. Files included with functions, e.g. the_header(), will not be compiled by Blade, however the php code in the file is still executed.