Download the PHP package bllim/datatables without Composer

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

Project is not being maintained actively.

You will most likely find a better more actively maintained fork here https://github.com/yajra/laravel-datatables

If you have issues please try and fix them and we will pull the changes if we can verify they work. That being said this project lacks automatic testing so it has become a difficult project to maintain. Please let us know if you are interested in adopting and maintaining this project, it is still pretty useful. 60% of the time, it works every time.

Datatables Bundle for Laravel 4

About

This bundle is created to handle the server-side processing of the DataTables Jquery Plugin (http://datatables.net) by using Eloquent ORM or Fluent Query Builder.

Feature Overview

Installation

Require bllim/datatables in composer.json and run composer update.

{
    "require": {
        "laravel/framework": "4.0.*",
        ...
        "bllim/datatables": "*"
    }
    ...
}

Composer will download the package. After the package is downloaded, open app/config/app.php and add the service provider and alias as below:

'providers' => array(
    ...
    'Bllim\Datatables\DatatablesServiceProvider',
),

'aliases' => array(
    ...
    'Datatables'      => 'Bllim\Datatables\Facade\Datatables',
),

Finally you need to publish a configuration file by running the following Artisan command.

Usage

It is very simple to use this bundle. Just create your own fluent query object or eloquent object without getting results (that means don't use get(), all() or similar methods) and give it to Datatables. You are free to use all Eloquent ORM and Fluent Query Builder features.

Some things you should know:

Examples

Example 1: Simple use

$posts = Post::select(array('posts.id','posts.name','posts.created_at','posts.status'));

return Datatables::of($posts)->make();

Example 2: Adding and editing columns

$place = Place::left_join('owner','places.author_id','=','owner.id')
   ->select(array('places.id','places.name','places.created_at','owner.name as ownername','places.status'));

return Datatables::of($place)
    ->add_column('operations', '<a href="{{ URL::route( \'admin.post\', array( \'edit\',$id )) }}">edit</a>
                    <a href="{{ URL::route( \'admin.post\', array( \'delete\',$id )) }}">delete</a>
                ')
    ->edit_column('status', '{{ $status ? 'Active' : 'Passive' }}')
    ->edit_column('ownername', function($row) {
        return "The author of this post is {$row->ownername}";
    })
    ->remove_column('id')
    ->make();

Notice: If you use double quotes while assigning the $content in an add_column or edit_column call, you should escape variables with a backslash (\) to prevent an error. For example:

edit_column('id', "{{ \$id }}") .

Example 3: Using filter_column

$clients = Client::select(array(
        'Client.id',
        DB::raw('CONCAT(Client.firstname," ",Client.lastname) as ClientName'),
        'Client.email',
        'Client.code',
        'Client.updated_at',
        'Client.isActive',
        'Language.name as LanguageName',
    ))
    ->leftJoin('Language', 'Client.Language_id', '=', 'Language.id')
    ->where('isDeleted', '!=', '1');

return Datatables::of($clients)
        ->filter_column('id', 'where', 'Client.id', '=', '$1')
        ->filter_column('code', 'where', 'Client.code', '=', DB::raw('UPPER($1)'))
        ->filter_column('LanguageName', 'whereIn', 'Language.name', function($value) { return explode(',',$value); })
        ->filter_column('updated_at', 'whereBetween', 'Client.updated_at', function($value) { return explode(',',$value); }, 'and')
        ->edit_column('isActive', '@if($isActive) <span class="label label-success">Active</span> @else <span class="label label-danger">Inactive</span> @endif')
        ->make();

Notes on filter_column:

Usage: filter_column ( $column_name, $method, $param_1, $param_2, ..., $param_n )

Example 4: Returning an array of objects

$posts = Post::select(array('posts.id','posts.name','posts.created_at','posts.status'));

return Datatables::of($posts)->make(true);

This returns a JSON array with data like below:

data: {
    {
        id: 12,
        name: 'Dummy Post',
        created_at: '1974-06-20 13:09:51'
        status: true
    }
    {
        id: 15,
        name: 'Test post please ignore',
        created_at: '1974-06-20 13:15:51',
        status: true
    }
}

Example 5: DT_RowID, DT_RowClass and DT_RowData

Example 6: Advanced usage of dataFullSupport

To better utilize dataTables mData (1.9), now columns.data (1.10) feature you may enable dataFullSupport by either setting it to true in the config file, or passing true to the second initialization argument Datatables::of($query, true)

Creating a table with a searchable and sortable joined table:

Notes on columns.data:

License: Licensed under the MIT License


All versions of datatables with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
illuminate/support Version >=4.0.0
illuminate/database Version >=4.0.0
illuminate/view Version >=4.0.0
illuminate/filesystem Version >=4.0.0
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 bllim/datatables contains the following files

Loading the files please wait ....