PHP Класс OpenSkill\Datatable\Views\DatatableView

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string | null $tableView, string | null $scriptView, Illuminate\Contracts\View\Factory $viewFactory, Illuminate\Contracts\Config\Repository $configRepository, array $columnConfiguration = [] ) DatatableView constructor, will take a view as a string if a custom one should be used. will also take the column configurations to provide out of the box headers for the view.
callback ( string $name, string $callback )
columns ( string $columnName, string $label = null ) Will set the columns for the view
endpoint ( $endpoint_url ) Sets the endpoint URL that will be passed to templates when rendering html & scripts.
headers ( ) Indicates that the current columns should have a header on the table
html ( ) : string Will render the table and directly the script after it. This is a shortcut for {@link #table} followed by {@link script}
id ( string $tableId ) Will set a new id on the table.
option ( string $name, mixed $options )
script ( ) : string Will render the javascript for the table
table ( ) : string Will render the table

Описание методов

__construct() публичный Метод

If no columns are given the user must provide them before building the view.
public __construct ( string | null $tableView, string | null $scriptView, Illuminate\Contracts\View\Factory $viewFactory, Illuminate\Contracts\Config\Repository $configRepository, array $columnConfiguration = [] )
$tableView string | null the name of the view that should be rendered for the table
$scriptView string | null the name of the view that should be rendered for the script
$viewFactory Illuminate\Contracts\View\Factory The factory used to render the views
$configRepository Illuminate\Contracts\Config\Repository The repository responsible for config resolution
$columnConfiguration array The columnConfiguration of the the server side if available

callback() публичный Метод

public callback ( string $name, string $callback )
$name string the name of the callback function
$callback string the body of the callback function

columns() публичный Метод

Will set the columns for the view
public columns ( string $columnName, string $label = null )
$columnName string The name of the column
$label string The label for this column

endpoint() публичный Метод

Sets the endpoint URL that will be passed to templates when rendering html & scripts.
public endpoint ( $endpoint_url )
$endpoint_url

headers() публичный Метод

Indicates that the current columns should have a header on the table
public headers ( )

html() публичный Метод

Will render the table and directly the script after it. This is a shortcut for {@link #table} followed by {@link script}
public html ( ) : string
Результат string Will return the rendered table and the rendered script as string

id() публичный Метод

Will set a new id on the table.
public id ( string $tableId )
$tableId string The new id that should be used for the DOM table

option() публичный Метод

public option ( string $name, mixed $options )
$name string the name of the option
$options mixed an array of options

script() публичный Метод

Will render the javascript for the table
public script ( ) : string
Результат string the rendered view that represents the script

table() публичный Метод

Will render the table
public table ( ) : string
Результат string the rendered view that represents the table