LayoutPluginManagerInterface.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace Drupal\Core\Layout;
  3. use Drupal\Component\Plugin\CategorizingPluginManagerInterface;
  4. /**
  5. * Provides the interface for a plugin manager of layouts.
  6. */
  7. interface LayoutPluginManagerInterface extends CategorizingPluginManagerInterface {
  8. /**
  9. * Gets theme implementations for layouts.
  10. *
  11. * @return array
  12. * An associative array of the same format as returned by hook_theme().
  13. *
  14. * @see hook_theme()
  15. */
  16. public function getThemeImplementations();
  17. /**
  18. * {@inheritdoc}
  19. *
  20. * @return \Drupal\Core\Layout\LayoutInterface
  21. */
  22. public function createInstance($plugin_id, array $configuration = []);
  23. /**
  24. * {@inheritdoc}
  25. *
  26. * @return \Drupal\Core\Layout\LayoutDefinition|null
  27. */
  28. public function getDefinition($plugin_id, $exception_on_invalid = TRUE);
  29. /**
  30. * {@inheritdoc}
  31. *
  32. * @return \Drupal\Core\Layout\LayoutDefinition[]
  33. */
  34. public function getDefinitions();
  35. /**
  36. * {@inheritdoc}
  37. *
  38. * @return \Drupal\Core\Layout\LayoutDefinition[]
  39. */
  40. public function getSortedDefinitions(array $definitions = NULL);
  41. /**
  42. * {@inheritdoc}
  43. *
  44. * @return \Drupal\Core\Layout\LayoutDefinition[][]
  45. */
  46. public function getGroupedDefinitions(array $definitions = NULL);
  47. /**
  48. * Returns an array of layout labels grouped by category.
  49. *
  50. * @return string[][]
  51. * A nested array of labels suitable for #options.
  52. */
  53. public function getLayoutOptions();
  54. }