Linux 软件免费装
Banner图

Blade

开发者 konvent
更新时间 2015年12月1日 14:26
PHP版本: 3.0.0 及以上
WordPress版本: 3.9
版权: GPLv2 or later
版权网址: 版权信息

标签

Blade Laravel Template Engine

下载

0.1.0 0.1.1 0.2.2 0.3.2 0.3.7

详情介绍:

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... <?php echo $foo ?> if() @if(has_post_thumbnail()) {{the_post_thumbnail() }} @else <img src="{{bloginfo( 'template_url' )}}/images/thumbnail-default.jpg" /> @endif Turns into... `<?php if(has_post_thumbnail()) : ?> <img src="<?php bloginfo( 'template_url' ) ?>/images/thumbnail-default.jpg" /> ` the loop @wpposts <a href="{{the_permalink()}}">{{the_title()}}</a><br> @wpempty <p>404</p> @wpend Turns into... `<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <a href="<?php the_permalink() ?>"><?php the_title() ?> 404 ` wordpress query `Turns into....` Advanced Custom Fields ` 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. Layouts master.php: ` @yield('content') page.php:@layout('master') @section('content') Lorem ipsum @endsection` See the Blade documentation for more info. Contribute on github: github.com/MikaelMattsson/blade

安装:

  1. Upload folder blade to the /wp-content/plugins/ directory
  2. 通过WordPress的“插件”菜单激活插件
  3. Make sure that /wp-content/plugins/blade/storage/views/ is writable by php
  4. Done! You can now use Blade in your theme
更多选项 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 “bladecache” in your theme folder. if(function_exists('blade_set_storage_path')){ blade_set_storage_path(get_template_directory().'/bladecache'); }

更新日志:

0.3.7 0.3.6 0.3.5 0.3.4 0.3.3 0.3.2 0.3.1 0.2.0 0.1.1 0.1.0