Download the PHP package crhayes/blade-partials without Composer

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

Blade Partials

This package introduces the concept of partials (not includes) in blade templating. Think of it like inline @extends functionality within your views.

Partials allow you to extend a view and inject content into it, inline, within your views.

Why?

To make it easier to create reusable components. I often find myself repeating a lot of HTML boilerplate when using frameworks like Bootstrap or Foundation, and this package reduces that. Furthermore, if we ever need to change the markup we don't need to hunt down every instance in our code to do so (DRY).

This functionality can be achieved by using @include, but that can be annoying when your templates are broken down into a ton of tiny templates scattered about.

Installation

Begin by installing this package through Composer.

Next open up app/config/app.php, comment out the Illuminate View Service Provider, and add the one from this package:

And that's it!

Creating a Partial

Partials start with the @partial('path.to.view') directive, which accepts the view you want the partial to extend from, and end with the @endpartial directive.

Blocks within partials behave the same way as sections within templates. They capture a piece of data that will be rendered into the extended view.

Rendering a Partial

We use the @render('block-to-render') directive to render a block of content that was provided via the respective @block directive. Note that we can also provide a default value.

Full Example

This example will include our partial HTML file. Notice that we can create as many instances of the partial as we like.

Nesting Partials

You can also do some cool things by nesting partials. For example:


All versions of blade-partials with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
illuminate/support Version 4.x
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 crhayes/blade-partials contains the following files

Loading the files please wait ....