Download the PHP package krisanalfa/bono-blade without Composer

On this page you can find all versions of the php package krisanalfa/bono-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 bono-blade

BonoBlade

Laravel Blade Template Engine for Bono PHP Framework

Note: BonoBlade also use Blade templating for partial view

Installation

Add this line to your composer.json file

Configuration

Add these lines to your configuration file

If you want to change layout file name, templates path, or cache path, you can add options in your provider like this

Note: You may use any other theme based on BladeTheme, such as blade foundation. Or you can create your own theme.

Basic usage

Layout example

Template example

Rendering template

Simply, you can render your template by call render function in \Bono\App instance.

Note: Be sure you're not adding .blade.php or your template will not found

Result

Rendering a page without layout

Working with sections

Note that views which extend a Blade layout simply override sections from the layout. Content of the layout can be included in a child view using the @parent directive in a section, allowing you to append to the contents of a layout section such as a sidebar or footer.

Sometimes, such as when you are not sure if a section has been defined, you may wish to pass a default value to the @yield directive. You may pass the default value as the second argument:

Including sub-views

You may also pass an array of data to the included view:

Overwriting sections

By default, sections are appended to any previous content that exists in the section. To overwrite a section entirely, you may use the overwrite statement:

The outpur is:

But if you change the second @stop to an @overwrite.

Then the following is output.

Extends template to be reuseable

Based on this case, your body section will be overriden by lorem ipsum and bluish content.

Other blade control structures

Echoing data

Echoing data after checking for existence

Sometimes you may wish to echo a variable, but you aren't sure if the variable has been set. Basically, you want to do this:

However, instead of writing a ternary statement, Blade allows you to use the following convenient short-cut:

Displaying raw text with curly braces

If you need to display a string that is wrapped in curly braces, you may escape the Blade behavior by prefixing your text with an @ symbol:

Of course, all user supplied data should be escaped or purified. To escape the output, you may use the triple curly brace syntax:

If you don't want the data to be escaped, you may use double curly-braces:

Note: Be very careful when echoing content that is supplied by users of your application. Always use the triple curly brace syntax to escape any HTML entities in the content.

If statements

Note: Method @unless is used when you want to write @if(! functionReturnBool())

Loops

Comments

Extending blade

Now you can use @dateTime($dateValue) to get your datetime value.

The createPlainMatcher method is used for directives with no arguments like @endif and @stop, while createMatcher is used for directives with arguments.

Now you can use @pre and @endpre whenever you want to print_r() your value. Just like this:

Setting the content tags blade uses

You know that blade uses {{ and }} to specify content to be output, but this conflicts with Mustache or some other library you're using. If you want to use other tags, you can use setContentTags method. Let's say you want to use [% and %] for your tags.

Then your template can contain code like.

You can also pass a third argument as true to indicate you're setting the tags to escape content.

Then instad of using {{{ and }}} you can use [-% and %-].

Note: You must call setContentTags method before using view. The best options is: make a Provider that preparing all of your Blade customization.


All versions of bono-blade with dependencies

PHP Build Version
Package Version
Requires illuminate/view Version 5.1.*
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 krisanalfa/bono-blade contains the following files

Loading the files please wait ....