PHP Class OpenSkill\Datatable\Datatable

Show file Open project: openskill/datatable Class Usage Examples

Public Methods

Method Description
__construct ( VersionEngine $versionEngine, Illuminate\Contracts\View\Factory $viewFactory, Illuminate\Contracts\Config\Repository $configRepository ) Datatable constructor.
make ( OpenSkill\Datatable\Providers\Provider $provider ) : ColumnComposer Will create a new DataComposer with the given provider as implementation.
view ( string $tableView = null, string $scriptView = null ) : DatatableView Will return a default DatatableView with no columns defined, but with the view and the version prepared.

Method Details

__construct() public method

Datatable constructor.
public __construct ( VersionEngine $versionEngine, Illuminate\Contracts\View\Factory $viewFactory, Illuminate\Contracts\Config\Repository $configRepository )
$versionEngine OpenSkill\Datatable\Versions\VersionEngine The version engine that determines the correct version
$viewFactory Illuminate\Contracts\View\Factory The factory used to handle the view generation
$configRepository Illuminate\Contracts\Config\Repository The repository responsible to get config values

make() public method

Will create a new DataComposer with the given provider as implementation.
public make ( OpenSkill\Datatable\Providers\Provider $provider ) : ColumnComposer
$provider OpenSkill\Datatable\Providers\Provider The provider for the underlying data.
return OpenSkill\Datatable\Composers\ColumnComposer

view() public method

The user is responsible to populate the view with the wished columns, because they can not be derived from the server side column configuration.
public view ( string $tableView = null, string $scriptView = null ) : DatatableView
$tableView string the name of the table view to render
$scriptView string the name of the script view to render
return OpenSkill\Datatable\Views\DatatableView the view to work with