{"id":23941,"date":"2013-06-23T18:37:49","date_gmt":"2013-06-23T18:37:49","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/blade\/"},"modified":"2015-12-01T06:26:09","modified_gmt":"2015-12-01T06:26:09","slug":"blade","status":"publish","type":"plugin","link":"https:\/\/tah.wordpress.org\/plugins\/blade\/","author":12361009,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.3.7","stable_tag":"0.3.7","tested":"3.9.40","requires":"3.0.0","requires_php":"","requires_plugins":"","header_name":"Blade","header_author":"Mikael Mattsson","header_description":"","assets_banners_color":"ffffff","last_updated":"2015-12-01 06:26:09","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/MikaelMattsson\/blade","header_author_uri":"http:\/\/www.wallmanderco.se","rating":4,"author_block_rating":0,"active_installs":200,"downloads":7331,"num_ratings":7,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":"1","2":0,"3":"1","4":"1","5":"4"},"assets_icons":[],"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":"846965","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1.0","0.1.1","0.2.2","0.3.2","0.3.7"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[12762,4298,12763,975],"plugin_category":[],"plugin_contributors":[86726],"plugin_business_model":[],"class_list":["post-23941","plugin","type-plugin","status-publish","hentry","plugin_tags-blade","plugin_tags-engine","plugin_tags-laravel","plugin_tags-template","plugin_contributors-konvent","plugin_committers-konvent"],"banners":{"banner":"https:\/\/ps.w.org\/blade\/assets\/banner-772x250.png?rev=846965","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/blade_ffffff.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>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.\nUsing a template engine will result in much cleaner template files and quicker development. Normal php can still be used in the template files.\nThe plugin also adds a wordpress specific snippet to blade. Check out the examples for more info.<\/p>\n\n<h4>echo\/print<\/h4>\n\n<pre><code>{{$foo}}\n<\/code><\/pre>\n\n<p>Turns into...\n    <\/p>\n\n<h4>if()<\/h4>\n\n<pre><code>@if(has_post_thumbnail())\n    {{the_post_thumbnail() }}\n@else \n    &lt;img src=\"{{bloginfo( 'template_url' )}}\/images\/thumbnail-default.jpg\" \/&gt;\n@endif\n<\/code><\/pre>\n\n<p>Turns into...\n    \n        \n    \n        &lt;img src=&quot;\/images\/thumbnail-default.jpg\" \/&gt;\n    <\/p>\n\n<h4>the loop<\/h4>\n\n<pre><code>@wpposts\n    &lt;a href=\"{{the_permalink()}}\"&gt;{{the_title()}}&lt;\/a&gt;&lt;br&gt;\n@wpempty\n    &lt;p&gt;404&lt;\/p&gt;\n@wpend\n<\/code><\/pre>\n\n<p>Turns into...\n    \n        &lt;a href=&quot;\"&gt;<\/a><br \/>\n    \n        <\/p><p>404<\/p>\n    \n\n<h4>wordpress query<\/h4>\n\n<pre><code>&lt;ul&gt;\n@wpquery(array('post_type' =&gt; 'post'))\n    &lt;li&gt;&lt;a href=\"{{the_permalink()}}\"&gt;{{the_title()}}&lt;\/a&gt;&lt;\/li&gt;\n@wpempty\n    &lt;li&gt;{{ __('Sorry, no posts matched your criteria.') }}&lt;\/li&gt;\n@wpend\n&lt;\/ul&gt;\n<\/code><\/pre>\n\n<p>Turns into....<\/p>\n\n<ul>\n     'post') ); ?&gt;\n    have_posts() ) : ?&gt;\n        have_posts() ) : $query-&gt;the_post(); ?&gt;\n            <li>&lt;a href=&quot;\"&gt;  <\/a><\/li>\n        \n    \n        <li><\/li>\n    \n    <\/ul>\n\n<h4>Advanced Custom Fields<\/h4>\n\n<pre><code>&lt;ul&gt;\n    @acfrepeater('images')\n        &lt;li&gt;{{ get_sub_field( 'image' ) }}&lt;\/li&gt;\n    @acfend\n&lt;\/ul&gt;\n<\/code><\/pre>\n\n<p>Turns into...<\/p>\n\n<ul>\n        \n            \n                <li>&lt;img src=&quot;\" \/&gt;<\/li>\n            \n        \n    <\/ul>\n\n<h4>Including other templates<\/h4>\n\n<p>To include a file with blade use:\n    @include('header')\nNote that you should not type \u201c.php\u201d. Files included with functions, e.g. the_header(), will not be compiled by Blade, however the php code in the file is still executed.<\/p>\n\n<h4>Layouts<\/h4>\n\n<p>master.php:\n    \n        \n            @yield('content')\n        \n    \npage.php:\n    @layout('master')<\/p>\n\n<pre><code>@section('content')\n    &lt;p&gt;Lorem ipsum&lt;\/p&gt;\n@endsection\n<\/code><\/pre>\n\n<p>See the <a href=\"http:\/\/three.laravel.com\/docs\/views\/templating\" title=\"Laravel 3 Templating\">Blade documentation<\/a> for more info.<\/p>\n\n<p>Contribute on github: <a href=\"https:\/\/github.com\/MikaelMattsson\/blade\">github.com\/MikaelMattsson\/blade<\/a><\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload folder <code>blade<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Make sure that <code>\/wp-content\/plugins\/blade\/storage\/views\/<\/code> is writable by php <\/li>\n<li>Done! You can now use Blade in your theme<\/li>\n<\/ol>\n\n<h4>More options<\/h4>\n\n<p>It is recommended thay you change the path to the location where the compiled views are stored to within your theme. This will fix problems with wpml. To do so, put the following code in your theme folder and create the folder\/directory \u201cbladecache\u201d in your theme folder.\n    if(function_exists('blade_set_storage_path')){\n        blade_set_storage_path(get_template_directory().'\/bladecache');\n    }<\/p>\n\n<!--section=changelog-->\n<h4>0.3.7<\/h4>\n\n<ul>\n<li>Added support for BuddyPress<\/li>\n<\/ul>\n\n<h4>0.3.6<\/h4>\n\n<ul>\n<li>Fixed bug with incorrectly appending to unitialized variable. (perholmang)<\/li>\n<li>Fixed issues when using multiple @section. (perholmang)<\/li>\n<\/ul>\n\n<h4>0.3.5<\/h4>\n\n<ul>\n<li>Added support for child\/parent-themes (perholmang)<\/li>\n<\/ul>\n\n<h4>0.3.4<\/h4>\n\n<ul>\n<li>Added acf repeater (jaggyspaghetti)<\/li>\n<\/ul>\n\n<h4>0.3.3<\/h4>\n\n<ul>\n<li>Compatibility update for PHP 5.5 (relu)<\/li>\n<\/ul>\n\n<h4>0.3.2<\/h4>\n\n<ul>\n<li>Added @wpposts (mykebates)<\/li>\n<\/ul>\n\n<h4>0.3.1<\/h4>\n\n<ul>\n<li>Changed the structure of all files. (PabloVallejo)<\/li>\n<\/ul>\n\n<h4>0.2.0<\/h4>\n\n<ul>\n<li>The view templates are now loaded differently.<\/li>\n<li>Better errorhandling.<\/li>\n<li>Added possibility to change the storage path.<\/li>\n<\/ul>\n\n<h4>0.1.1<\/h4>\n\n<ul>\n<li>Added a fix for plugins that import the template file directly using the template path fetched using get_query_template() like WP e-Commerce;<\/li>\n<\/ul>\n\n<h4>0.1.0<\/h4>\n\n<ul>\n<li>initial (beta)<\/li>\n<\/ul>","raw_excerpt":"Brings Laravel&#039;s great template engine, Blade, to Wordpress. Just install and start using blade in your theme.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/23941","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=23941"}],"author":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/konvent"}],"wp:attachment":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=23941"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=23941"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=23941"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=23941"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=23941"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=23941"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}