ilateral\SilverStripe\ModelAdminPlus\ModelAdminSnippet
Object representing a snippet of generic data that can be loaded at the top of a ModelAdminPlus interface
Synopsis
class ModelAdminSnippet
extends ViewableData
implements
GridField_HTMLProvider
{
- // constants
- const PRIMARY = "primary";
- const SECONDARY = "secondary";
- const SUCCESS = "success";
- const INFO = "info";
- const WARNING = "warning";
- const DANGER = "danger";
- const LIGHT = "light";
- const DARK = "dark";
- const WHITE = "white";
- // members
- protected $targetFragment;
- protected GridField $gridfield;
- private static $title;
- private static integer $priority = 0;
- private static string $background = self::INFO;
- private static string $text = self::WHITE;
- protected array $extra_classes = ;
- private array $casting = ;
- // methods
- public void __construct()
- public void getHTMLFragments()
- public string getTitle()
- public void getOrder()
- public string getSnippet()
- public string getBackgroundColour()
- public string getTextColour()
- public abstract string getContent()
- public string getExtraClasses()
- public ModelAdminSnippet addExtraClasses()
- public ModelAdminSnippet removeExtraClasses()
- public GridField getGridfield()
Hierarchy
Extends
- SilverStripe\View\ViewableData
Implements
- SilverStripe\Forms\GridField\GridField_HTMLProvider
Constants
Name | Value |
---|---|
PRIMARY | "primary" |
SECONDARY | "secondary" |
SUCCESS | "success" |
INFO | "info" |
WARNING | "warning" |
DANGER | "danger" |
LIGHT | "light" |
DARK | "dark" |
WHITE | "white" |
Members
private
- $background
—
string
Default background colour - $casting
- $priority
—
int
The order in which this snippet will be loaded - $text
—
string
Default text colour - $title
—
string
The name/title of the current snippet.
protected
- $extra_classes
—
array
List of extra CSS classes applied to this snippet - $gridfield
—
SilverStripe\Forms\GridField\GridField
The current parent gridfield - $targetFragment — string
Methods
public
- __construct()
- addExtraClasses() — Add additional css classes
- getBackgroundColour() — Return the background colour suitable for a template
- getContent() — The content of this snippet that will be rendered below the title.
- getExtraClasses() — Get extra CSS classes as a string
- getGridfield() — Get the current parent gridfield
- getHTMLFragments()
- getOrder()
- getSnippet() — Render the current snippet
- getTextColour() — Return the background colour suitable for a template
- getTitle() — Return an i18n friendly version of the title.
- removeExtraClasses() — Remove provided CSS classes