2017 © Pedro Peláez
 

library cells

Cells are view components for Laravel 4. They are mini-controllers with their own MVC stack, can invoke logic and render views.

image

torann/cells

Cells are view components for Laravel 4. They are mini-controllers with their own MVC stack, can invoke logic and render views.

  • Tuesday, June 3, 2014
  • by torann
  • Repository
  • 3 Watchers
  • 11 Stars
  • 752 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Cells for Laravel 4 - Beta

Latest Stable Version Total Downloads, (*1)

Cells are view components for Laravel 4. They are mini-controllers with their own MVC stack, can invoke logic and render views., (*2)


Installation

To get the latest version of Cells simply require it in your composer.json file., (*3)

"torann/cells": "dev-master"

You'll then need to run composer install to download it and have the autoloader updated., (*4)

Once Cells is installed you need to register the service provider with the application. Open up app/config/app.php and find the providers key., (*5)

'providers' => array(

    'Torann\Cells\CellsServiceProvider',

)

Cells also ships with a facade which provides the static syntax for creating collections. You can register the facade in the aliases key of your app/config/app.php file., (*6)

'aliases' => array(

    'Cells' => 'Torann\Cells\Facades\CellsFacade',

)

Create configuration file using artisan, (*7)

$ php artisan config:publish torann/cells

Creating a cell

You can create a cell using artisan command:, (*8)

php artisan cells:create demo

The parameter is the cell name., (*9)

Now you will see a controller class at /app/cells/CellDemo.php and view at /app/cells/demo/display.blade.php, (*10)

Rendering

Using the Blade helper, (*11)

@cell('demo', 'display')
  • The first parameter is the cell name.
  • The second parameter is the view type, by default it is "display".

Calling your cell in a view and passing Demo Cell! as the label, (*12)

echo Cells::get('demo', 'display', array('label' => 'Demo Cell!'));

Caching

Cells can be cached based on minutes. Simple change the $cache variable in the cell controller to the number of minutes the cell should be cached., (*13)

class CellDemo extends CellBaseController {

    /**
     * Default cache value in minutes.
     *
     * @var string
     */
    public $cache = 60;

}

By default caching is disabled in the local environment. To enable this change the setting disable_cache_in_dev to false in the config file., (*14)

The Versions

03/06 2014

dev-master

9999999-dev

Cells are view components for Laravel 4. They are mini-controllers with their own MVC stack, can invoke logic and render views.

  Sources   Download

BSD 2-Clause

The Requires

 

laravel widget laravel4 layout cells

02/06 2014

0.1.1

0.1.1.0

Cells are view components for Laravel 4. They are mini-controllers with their own MVC stack, can invoke logic and render views.

  Sources   Download

BSD 2-Clause

The Requires

 

laravel widget laravel4 layout cells

24/10 2013

0.1.0

0.1.0.0

Cells are view components for Laravel 4. They are mini-controllers with their own MVC stack, can invoke logic and render views.

  Sources   Download

BSD 2-Clause

The Requires

 

laravel widget laravel4 layout cells