Download the PHP package samvaughton/ldt without Composer

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

DataTables Library for Laravel 4

Build Status

This library is for the server side processing of the client requests. It aims to be different than existing DataTable packages, taking a different approach that allows greater flexibility.

Composer

Then run composer update.

Simple Example

I have imported the necessary namespace paths via use for DataTable, LaravelBuilder, Request and Column. DateColumnProcessor is a custom class, you can look at an example in the Column namespace.

Quite a lot is going on here, but it is very readable. The DataTable class accepts three parameters. A class that implements BuilderInterface (there is one already built for Laravel), a Request class which handles the parsing of the client side request and thirdly an array of columns which are visible to the user.

The first two parameters will be kept exactly the same 99% of the time.

Column

The column class accepts two parameters, the first one is required. It can either be a string or an array, this depends on the complexity of the column.

Each column can either be dynamic or static. A dynamic column is one that originates from the data source. Whereas a static column is appended onto the results after being fetched. Such as an actions column that contains buttons for edit, delete etc..

Aliases

If you are using aliases in your query and performing searches as well, then you will need to use an array to define the SQL column separately. An example will clear this up.

The select statement is using an alias, since MySQL cannot utilise aliases within the WHERE clause, we have to use its original column name customers.name. Otherwise the generated SQL for WHERE would look something like:

WHERE `customerName` LIKE '%john doe%'

Which is illegal.

Options

The column class has default options which are listed below and explained, these can be set via the second parameter like the example above.

Processor's

The rowProcessor options allows you to run a function against each column's data, this is for scenarios where you need to append some action buttons or convert a unix timestamp to a more readable date.

This is a static column that appends an edit button onto every row, it utilises the customers id from the $row array. You may be wondering what the $originalRow is for, this is an untouched row that contains every column from your select statement. Using the above code, if we were to modify the id column and set the value to null then this processor would return:

<a href="/customer/edit/">Edit</a>

Due to the id column being modified before this one. Here we could utilise $originalRow['id'] to get the unaltered value.

If you are trying to use a column that isn't defined within the column array then you have to use $originalRow as these columns are not contained within $row.

Instead of passing a callback, you can also pass a class that implements the RowProcessorInterface.

The column instantiation may look something like this:

The filterTermProcessor option is similar to the rowProcessor except that it modifies the search term before the query is executed to fetch the results. Say you only wanted users to search in lowercase you could provide a callback/class that performs this.

You can find examples of these processors within the Samvaughton\Ldt\Column namespace.

Contributing

I would love for people to help contribute to this library, send a pull request and I'll check it out!

Todo:


All versions of ldt with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
illuminate/database Version 4.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 samvaughton/ldt contains the following files

Loading the files please wait ....