SilverStripe\Widgets\Model\Widget
Widgets let CMS authors drag and drop small pieces of functionality into defined areas of their websites.
You can use forms in widgets by implementing a .
See for more information.
Synopsis
class Widget
extends DataObject
{
- // members
- private static array $db = ;
- private static array $defaults = ;
- private static array $casting = ;
- private static array $only_available_in = ;
- private static array $has_one = ;
- private static string $default_sort = "\"Sort\"";
- private static string $cmsTitle = "Name of this widget";
- private static string $description = "Description of what this widget does.";
- private static array $summary_fields = ;
- private static string $table_name = 'Widget';
- private static array $extensions = ;
- protected WidgetController $controller;
- // methods
- public void populateDefaults()
- public string WidgetHolder()
- public string forTemplate()
- public string Content()
- public string getCMSTitle()
- public string getDescription()
- public string DescriptionSegment()
- public string EditableSegment()
- public FieldList getCMSFields()
- public FieldList CMSEditor()
- public string ClassName()
- public string Name()
- public WidgetController getController()
- public void populateFromPostData()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Members
private
- $casting
- $cmsTitle — string
- $db
- $default_sort
- $defaults
- $description — string
- $extensions
- $has_one
- $only_available_in
- $summary_fields
- $table_name
protected
- $controller — SilverStripe\Widgets\Model\WidgetController
Methods
public
- CMSEditor()
- ClassName() — A fully qualified class name is returned with underscores instead of backslashes so it is HTML safe. Dashes can't be used as they're handled in the Javascript for other purposes.
- Content() — Renders the widget content in a custom template with the same name as the current class. This should be the main point of output customization.
- DescriptionSegment()
- EditableSegment()
- Name()
- WidgetHolder() — Note: Overloaded in {@link WidgetController}.
- forTemplate() — Default way to render widget in templates.
- getCMSFields()
- getCMSTitle()
- getController()
- getDescription()
- populateDefaults()
- populateFromPostData()