Download the PHP package johntaa/blade without Composer

On this page you can find all versions of the php package johntaa/blade. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package blade

Logo

BladeOne

BladeOne is a standalone version of Blade Template Engine that uses a single php file and can be ported and used in different projects.

Introduction (From Laravel webpage)

Blade is the simple, yet powerful templating engine provided with Laravel. Unlike other popular PHP templating engines, Blade does not restrict you from using plain PHP code in your views. All Blade views are compiled into plain PHP code and cached until they are modified, meaning Blade adds essentially zero overhead to your application. Blade view files use the .blade.php file extension and are typically stored in the resources/views directory.

About this version

By standard, Blade is part of Laravel (Illuminate components) and for to use it, you requires to install Laravel and Illuminate-view components. Blade as a template engine is pretty nice and clear. Also it generates a (some that) clean code. And its starting to be considered a de-facto template system for php (Smarty has been riding off the sunset since years ago). So, if we are able to use it without Laravel then its a big plus for many projects. In fact, in theory its is even possible to use with Laravel. Exists different version of Blade Template that runs without Laravel but most requires 50 or more files and those templates add a new level of complexity:

This project uses a single file called BladeOne.php and a single class (called BladeOne). If you want to use it then include it, creates the folders and that's it!. Nothing more (not even namespaces)*[]:

Usage

example.php:

Or using composer's autoload.php

(modify composer.json as follow) and run "composer update"

Where $views is the folder where the views (templates not compiled) will be stored. $cache is the folder where the compiled files will be stored.

In this example, the BladeOne opens the template hello. So in the views folders it should exists a file called hello.blade.php

views/hello.blade.php:

Business Logic/Controller methods

constructor

run

BLADEONE_MODE (global constant) (optional)

Template tags

Template Inheritance

In the master page (layout)

Tag Note status
@section('sidebar') Start a new section 0.2b ok
@show Indicates where the content of section will be displayed 0.2 ok
@yield('title') Show here the content of a section 0.2b ok

Using the master page (using the layout)

Tag Note status
@extends('layouts.master') Indicates the layout to use 0.2b ok
@section('title', 'Page Title') Sends a single text to a section 0.2b ok
@section('sidebar') Start a block of code to send to a section 0.2b ok
@endsection End a block of code 0.2b ok
@parent Show the original code of the section REMOVED(*)

Note :(*) This feature is in the original documentation but its not implemented neither its required. May be its an obsolete feature.

variables

Tag Note status
{{$variable1}} show the value of the variable using htmlentities (avoid xss attacks) 0.2b ok
@{{$variable1}} show the value of the content directly (not evaluated, useful for js) 0.2b ok
{!!$variable1!!} show the value of the variable without htmlentities (no escaped) 0.2b ok
{{ $name or 'Default' }} value or default 0.2b ok
{{Class::StaticFunction($variable)}} call and show a function (the function should return a value) 0.2b ok

logic

Tag Note status
@if (boolean) if logic-conditional 0.2b ok
@elseif (boolean) else if logic-conditional 0.2b ok
@else else logic 0.2b ok
@endif end if logic 0.2b ok
@unless(boolean) execute block of code is boolean is false 0.2b ok

loop

Tag Note status
@for($i = 0; $i < 10; $i++) for loop 0.2b ok
@endfor end of for loop 0.2b ok
@foreach($array as $obj) foreach loop 0.2b ok
@endforeach end of foreach loop 0.2b ok
@forelse($array as $obj) inverse foreach loop not tested
@empty if forelse loop is empty the executes the next block not tested
@endforelse end of forelse block not tested
@while(boolean) while loop not tested
@endwhile end while loop not tested

Sub Views

Tag Note status
@include('folder.template') Include a template 0.2b ok
@include('folder.template',['some' => 'data']) Include a template with new variables 0.2b ok
@each('view.name', $array, 'variable') Includes a template for each element of the array 0.2b ok

Note: Templates called folder.template is equals to folder/template

Comments

Tag Note status
{{-- text --}} Include a comment 0.2b ok

Stacks

Tag Note status
@push('elem') Add the next block to the push stack 0.2b ok
@endpush End the push block 0.2b ok
@stack('elem') Show the stack 0.2b ok

@set (new for 1.5)

@set($variable=[value]) @set($variable) is equals to @set($variable=$variable+1)

Service Inject

Tag Note status
@inject('metrics', 'App\Services\MetricsService') Used for insert a Laravel Service NOT SUPPORTED

Extending Blade

Not compatible with the extension of Laravel's Blade.

Extensions Libraries (optional)

BladeOneHtml Documentation

BladeOneLogic Documentation

BladeOneCache Documentation

Definition of Blade Template

https://laravel.com/docs/5.2/blade

Differences between Blade and BladeOne

Differences between Blade+Laravel and BladeOne+BladeOneHTML

Instead of use the Laravel functions, for example Form::select

We have native tags as @select,@item,@items and @endselect

This new syntaxis add an (optionally) a non-selected row. Also, BladeOneHTML adds multiple select, fixed values (without array), grouped select and many more.

Todo

Version

=======

Collaboration

You are welcome to use it, share it, ask for changes and whatever you want to. Just keeps the copyright notice in the file.

Future

I checked the code of BladeOne and i know that there are a lot of room for improvement.

License

MIT License. BladeOne (c) 2016 Jorge Patricio Castro Castillo Blade (c) 2012 Laravel Team (This code is based and use the work of the team of Laravel.)


All versions of blade with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package johntaa/blade contains the following files

Loading the files please wait ....