class Layout in Layout Plugin (obsolete, use core's Layout Discovery) 8
Same name in this branch
- 8 src/Layout.php \Drupal\layout_plugin\Layout
- 8 src/Annotation/Layout.php \Drupal\layout_plugin\Annotation\Layout
Defines a Layout annotation object.
Layouts are used to define a list of regions and then output render arrays in each of the regions, usually using a template.
Plugin namespace: Plugin\Layout
Hierarchy
- class \Drupal\Component\Annotation\Plugin implements AnnotationInterface
- class \Drupal\layout_plugin\Annotation\Layout
Expanded class hierarchy of Layout
See also
\Drupal\layout_plugin\Plugin\Layout\LayoutInterface
\Drupal\layout_plugin\Plugin\Layout\LayoutBase
\Drupal\layout_plugin\Plugin\Layout\LayoutPluginManager
1 string reference to 'Layout'
2 classes are annotated with Layout
- LayoutExampleTest in modules/
layout_plugin_example/ src/ Plugin/ Layout/ LayoutExampleTest.php - The plugin that handles the default layout template.
- LayoutTestPlugin in tests/
modules/ layout_test/ src/ Plugin/ Layout/ LayoutTestPlugin.php - The plugin that handles the default layout template.
File
- src/
Annotation/ Layout.php, line 22
Namespace
Drupal\layout_plugin\AnnotationView source
class Layout extends Plugin {
/**
* The plugin ID.
*
* @var string
*/
public $id;
/**
* The layout type.
*
* Available options:
* - full: Layout for the whole page.
* - page: Layout for the main page response.
* - partial: A partial layout that is typically used for sub-regions.
*
* @var string
*/
public $type = 'page';
/**
* The human-readable name.
*
* @var \Drupal\Core\Annotation\Translation
*
* @ingroup plugin_translatable
*/
public $label;
/**
* An optional description for advanced layouts.
*
* Sometimes layouts are so complex that the name is insufficient to describe
* a layout such that a visually impaired administrator could layout a page
* for a non-visually impaired audience. If specified, it will provide a
* description that is used for accessibility purposes.
*
* @var \Drupal\Core\Annotation\Translation
*
* @ingroup plugin_translatable
*/
public $description;
/**
* The human-readable category.
*
* @var \Drupal\Core\Annotation\Translation
*
* @ingroup plugin_translatable
*/
public $category;
/**
* The theme hook used to render this layout.
*
* If specified, it's assumed that the module or theme registering this layout
* will also register the theme hook with hook_theme() itself. This is
* mutually exclusive with 'template' - you can't specify both.
*
* @var string optional
*
* @see hook_theme()
*/
public $theme;
/**
* The template file to render this layout (relative to the 'path' given).
*
* If specified, then the layout_plugin module will register the template with
* hook_theme() and the module or theme registering this layout does not need
* to do it. This is mutually exclusive with 'theme' - you can't specify both.
*
* @var string optional
*
* @see hook_theme()
*/
public $template;
/**
* Path (relative to the module or theme) to resources like icon or template.
*
* @var string optional
*/
public $path;
/**
* The asset library.
*
* If specified, it's assumed that the module or theme registering this layout
* will also register the library in its *.libraries.yml itself. This is
* mutually exclusive with 'css' - you can't specify both.
*
* @var string optional
*/
public $library;
/**
* The CSS file.
*
* If specified, then the layout_plugin module will register the library for
* this CSS file automatically and the module or theme registering this layout
* does not need to do it. This is mutually exclusive with 'library' - you
* can't specify both.
*
* @var string optional
*
* @deprecated when moving layout plugin to core
*/
public $css;
/**
* The path to the preview image (relative to the 'path' given).
*
* @var string optional
*/
public $icon;
/**
* An associative array of regions in this layout.
*
* The key of the array is the machine name of the region, and the value is
* an associative array with the following keys:
* - label: (string) The human-readable name of the region.
*
* Any remaining keys may have special meaning for the given layout plugin,
* but are undefined here.
*
* @var array
*/
public $regions = array();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Layout:: |
public | property | The human-readable category. | |
Layout:: |
public | property | The CSS file. | |
Layout:: |
public | property | An optional description for advanced layouts. | |
Layout:: |
public | property | The path to the preview image (relative to the 'path' given). | |
Layout:: |
public | property | The plugin ID. | |
Layout:: |
public | property | The human-readable name. | |
Layout:: |
public | property | The asset library. | |
Layout:: |
public | property | Path (relative to the module or theme) to resources like icon or template. | |
Layout:: |
public | property | An associative array of regions in this layout. | |
Layout:: |
public | property | The template file to render this layout (relative to the 'path' given). | |
Layout:: |
public | property | The theme hook used to render this layout. | |
Layout:: |
public | property | The layout type. | |
Plugin:: |
protected | property | The plugin definition read from the class annotation. | 1 |
Plugin:: |
public | function |
Gets the value of an annotation. Overrides AnnotationInterface:: |
5 |
Plugin:: |
public | function |
Gets the class of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Gets the unique ID for this annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Gets the name of the provider of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
protected | function | Parses an annotation into its definition. | |
Plugin:: |
public | function |
Sets the class of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Sets the name of the provider of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function | Constructs a Plugin object. | 2 |