PHP Class GridFieldAddNewMultiClass, silverstripe-gridfieldextensions

By default the list of classes that are createable is the grid field's model class, and any subclasses. This can be customised using {@link setClasses()}.
Inheritance: implements GridField_HTMLProvider, implements GridField_URLHandler
Afficher le fichier Open project: ajshort/silverstripe-gridfieldextensions Class Usage Examples

Protected Properties

Свойство Type Description
$itemRequestClass string

Méthodes publiques

Méthode Description
__construct ( string $fragment = 'before' )
getClasses ( GridField $grid ) : array Gets the classes that can be created using this button, defaulting to the model class and its subclasses.
getFragment ( ) : string Gets the fragment name this button is rendered into.
getHTMLFragments ( $grid ) {@inheritDoc}
getTitle ( ) : string Gets the button title text.
getURLHandlers ( $grid ) {@inheritDoc}
handleAdd ( GridField $grid, SS_HTTPRequest $request ) : GridFieldAddNewMultiClassHandler Handles adding a new instance of a selected class.
setClasses ( array $classes, $default = null ) : GridFieldAddNewMultiClass Sets the classes that can be created using this button.
setDefaultClass ( string $default ) : GridFieldAddNewMultiClass Sets the default class that is selected automatically.
setFragment ( string $fragment ) : GridFieldAddNewMultiClass Sets the fragment name this button is rendered into.
setItemRequestClass ( $class )
setTitle ( string $title ) : GridFieldAddNewMultiClass Sets the button title text.

Method Details

__construct() public méthode

public __construct ( string $fragment = 'before' )
$fragment string the fragment to render the button in

getClasses() public méthode

Gets the classes that can be created using this button, defaulting to the model class and its subclasses.
public getClasses ( GridField $grid ) : array
$grid GridField
Résultat array a map of class name to title

getFragment() public méthode

Gets the fragment name this button is rendered into.
public getFragment ( ) : string
Résultat string

getHTMLFragments() public méthode

{@inheritDoc}
public getHTMLFragments ( $grid )

getTitle() public méthode

Gets the button title text.
public getTitle ( ) : string
Résultat string

getURLHandlers() public méthode

{@inheritDoc}
public getURLHandlers ( $grid )

handleAdd() public méthode

Handles adding a new instance of a selected class.
public handleAdd ( GridField $grid, SS_HTTPRequest $request ) : GridFieldAddNewMultiClassHandler
$grid GridField
$request SS_HTTPRequest
Résultat GridFieldAddNewMultiClassHandler

setClasses() public méthode

Sets the classes that can be created using this button.
public setClasses ( array $classes, $default = null ) : GridFieldAddNewMultiClass
$classes array a set of class names, optionally mapped to titles
Résultat GridFieldAddNewMultiClass $this

setDefaultClass() public méthode

Sets the default class that is selected automatically.
public setDefaultClass ( string $default ) : GridFieldAddNewMultiClass
$default string the class name to use as default
Résultat GridFieldAddNewMultiClass $this

setFragment() public méthode

Sets the fragment name this button is rendered into.
public setFragment ( string $fragment ) : GridFieldAddNewMultiClass
$fragment string
Résultat GridFieldAddNewMultiClass $this

setItemRequestClass() public méthode

public setItemRequestClass ( $class )

setTitle() public méthode

Sets the button title text.
public setTitle ( string $title ) : GridFieldAddNewMultiClass
$title string
Résultat GridFieldAddNewMultiClass $this

Property Details

$itemRequestClass protected_oe property

protected string $itemRequestClass
Résultat string