DisplayPluginInterface
interface DisplayPluginInterface (View source)
Provides an interface for Views display plugins.
Methods
Initializes the display plugin.
Destroys the display's components and the display itself.
Determines if this display is the 'default' display.
Determines if this display uses exposed filters.
Determines if this display should display the exposed filters widgets.
Whether the display allows the use of AJAX or not.
Whether the display is actually using AJAX or not.
Whether the display is enabled.
Whether the display allows the use of a pager or not.
Whether the display is using a pager or not.
Whether the display allows the use of a 'more' link or not.
Whether the display is using the 'more' link or not.
Does the display have groupby enabled?
Should the enabled display more link be shown when no more items?
Does the display have custom link text?
Determines whether this display can use attachments.
Returns whether the display can use attachments.
Returns whether the display can use areas.
Allows displays to attach to other views.
Lists the 'defaultable' sections and what items each section contains.
Checks to see if the display has a 'path' field.
Checks to see if the display has some need to link to another display.
Checks to see if the display can put the exposed form in a block.
Find out all displays which are attached to this display.
Returns the ID of the display to use when making links.
Returns the base path to use for this display.
Points to the display which can be linked by this display.
Determines if an option is set to use the default or current display.
Gets an option, from this display or the default display.
Determines if the display's style uses fields.
Get the instance of a plugin, for example style or row.
Get the handler object for a single handler.
Get a full array of handlers for $type. This caches them.
Retrieves a list of fields for the current display.
Sets an option, on this display or the default display.
Set an option and force it to be an override.
Returns a link to a section of a form.
Returns to tokens for arguments.
Provides the default summary for options in the views UI.
Provides the default form for setting options.
Performs any necessary changes to the form values prior to storage.
If override/revert was clicked, perform the proper toggle.
Flip the override setting for the given section.
Injects anything into the query that the display handler needs.
Does nothing (obsolete function).
Checks to see if the display plugins support pager rendering.
Renders the 'more' link.
Renders this display.
pre_render callback for view display rendering.
Renders one of the available areas.
Determines if the user has access to this display of the view.
Sets up any variables on the view prior to execution.
Calculates the display's cache metadata by inspecting each handler/plugin.
Gets the cache metadata.
Executes the view and returns data in the format required.
Builds a basic render array which can be properly render cached.
Builds a renderable array of the view.
Renders the display for the purposes of a live preview.
Returns the display type that this display requires.
Make sure the display and all associated handlers are valid.
Reacts on adding a display.
Reacts on deleting a display.
Checks if the provided identifier is unique.
Is the output of the view empty.
Provides the block system with any exposed widget blocks for this display.
Renders the exposed form as block.
Provides help text for the arguments.
Provides help text for pagers.
Merges default values for all plugin types.
Gets the display extenders.
Details
initDisplay(ViewExecutable $view, array $display, array $options = NULL)
Initializes the display plugin.
destroy()
Destroys the display's components and the display itself.
isDefaultDisplay()
Determines if this display is the 'default' display.
'Default' display contains fallback settings.
usesExposed()
Determines if this display uses exposed filters.
displaysExposed()
Determines if this display should display the exposed filters widgets.
Regardless of what this function returns, exposed filters will not be used nor displayed unless usesExposed() returns TRUE.
bool
usesAJAX()
Whether the display allows the use of AJAX or not.
bool
ajaxEnabled()
Whether the display is actually using AJAX or not.
bool
isEnabled()
Whether the display is enabled.
bool
usesPager()
Whether the display allows the use of a pager or not.
bool
isPagerEnabled()
Whether the display is using a pager or not.
bool
usesMore()
Whether the display allows the use of a 'more' link or not.
bool
isMoreEnabled()
Whether the display is using the 'more' link or not.
useGroupBy()
Does the display have groupby enabled?
useMoreAlways()
Should the enabled display more link be shown when no more items?
useMoreText()
Does the display have custom link text?
bool
acceptAttachments()
Determines whether this display can use attachments.
bool
usesAttachments()
Returns whether the display can use attachments.
bool
usesAreas()
Returns whether the display can use areas.
attachTo(ViewExecutable $view, string $display_id, array $build)
Allows displays to attach to other views.
defaultableSections($section = NULL)
Lists the 'defaultable' sections and what items each section contains.
hasPath()
Checks to see if the display has a 'path' field.
This is a pure function and not just a setting on the definition because some displays (such as a panel pane) may have a path based upon configuration.
By default, displays do not have a path.
usesLinkDisplay()
Checks to see if the display has some need to link to another display.
For the most part, displays without a path will use a link display. However, sometimes displays that have a path might also need to link to another display. This is true for feeds.
usesExposedFormInBlock()
Checks to see if the display can put the exposed form in a block.
By default, displays that do not have a path cannot disconnect the exposed form and put it in a block, because the form has no place to go and Views really wants the forms to go to a specific page.
getAttachedDisplays()
Find out all displays which are attached to this display.
The method is just using the pure storage object to avoid loading of the sub displays which would kill lazy loading.
getLinkDisplay()
Returns the ID of the display to use when making links.
getPath()
Returns the base path to use for this display.
This can be overridden for displays that do strange things with the path.
DisplayRouterInterface|null
getRoutedDisplay()
Points to the display which can be linked by this display.
If the display has route information, the display itself is returned. Otherwise, the configured linked display is returned. For example, if a block display links to a page display, the page display will be returned in both cases.
Url|null
getUrl()
Returns a URL to $this display or its configured linked display.
true
isDefaulted($option)
Determines if an option is set to use the default or current display.
getOption($option)
Gets an option, from this display or the default display.
bool
usesFields()
Determines if the display's style uses fields.
ViewsPluginInterface
getPlugin(string $type)
Get the instance of a plugin, for example style or row.
getHandler($type, $id)
Get the handler object for a single handler.
ViewsHandlerInterface[]
getHandlers($type)
Get a full array of handlers for $type. This caches them.
array
getFieldLabels(bool $groupable_only = FALSE)
Retrieves a list of fields for the current display.
This also takes into account any associated relationships, if they exist.
setOption($option, $value)
Sets an option, on this display or the default display.
overrideOption($option, $value)
Set an option and force it to be an override.
optionLink($text, $section, $class = '', $title = '')
Returns a link to a section of a form.
Because forms may be split up into sections, this provides an easy URL to exactly the right section. Don't override this.
getArgumentsTokens()
Returns to tokens for arguments.
This function is similar to views_handler_field::getRenderTokens() but without fields tokens.
optionsSummary($categories, $options)
Provides the default summary for options in the views UI.
This output is returned as an array.
buildOptionsForm($form, FormStateInterface $form_state)
Provides the default form for setting options.
validateOptionsForm($form, FormStateInterface $form_state)
Validates the options form.
submitOptionsForm($form, FormStateInterface $form_state)
Performs any necessary changes to the form values prior to storage.
There is no need for this function to actually store the data.
optionsOverride($form, FormStateInterface $form_state)
If override/revert was clicked, perform the proper toggle.
setOverride(string $section, bool $new_state = NULL)
Flip the override setting for the given section.
query()
Injects anything into the query that the display handler needs.
renderFilters()
Does nothing (obsolete function).
renderPager()
Checks to see if the display plugins support pager rendering.
renderMoreLink()
Renders the 'more' link.
render()
Renders this display.
array
elementPreRender(array $element)
pre_render callback for view display rendering.
array
renderArea(string $area, bool $empty = FALSE)
Renders one of the available areas.
access(AccountInterface $account = NULL)
Determines if the user has access to this display of the view.
preExecute()
Sets up any variables on the view prior to execution.
These are separated from execute because they are extremely common and unlikely to be overridden on an individual display.
CacheableMetadata
calculateCacheMetadata()
Calculates the display's cache metadata by inspecting each handler/plugin.
CacheableMetadata
getCacheMetadata()
Gets the cache metadata.
execute()
Executes the view and returns data in the format required.
The base class cannot be executed.
static array
buildBasicRenderable(string $view_id, string $display_id, array $args = [])
Builds a basic render array which can be properly render cached.
In order to be rendered cached, it includes cache keys as well as the data required to load the view on cache misses.
array
buildRenderable(array $args = [], bool $cache = TRUE)
Builds a renderable array of the view.
Note: This does not yet contain the executed view, but just the loaded view executable.
preview()
Renders the display for the purposes of a live preview.
Also might be used for some other AJAXy reason.
string
getType()
Returns the display type that this display requires.
This can be used for filtering views plugins. E.g. if a plugin category of 'foo' is specified, only plugins with no 'types' declared or 'types' containing 'foo'. If you have a type of bar, this plugin will not be used. This is applicable for style, row, access, cache, and exposed_form plugins.
Empty
validate()
Make sure the display and all associated handlers are valid.
newDisplay()
Reacts on adding a display.
remove()
Reacts on deleting a display.
bool
isIdentifierUnique(string $id, string $identifier)
Checks if the provided identifier is unique.
bool
outputIsEmpty()
Is the output of the view empty.
If a view has no result and neither the empty, nor the footer nor the header does show anything return FALSE.
getSpecialBlocks()
Provides the block system with any exposed widget blocks for this display.
array|null
viewExposedFormBlocks()
Renders the exposed form as block.
array
getArgumentText()
Provides help text for the arguments.
array
getPagerText()
Provides help text for pagers.
mergeDefaults()
Merges default values for all plugin types.
DisplayExtenderPluginBase[]
getExtenders()
Gets the display extenders.