TipPluginInterface.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. namespace Drupal\tour;
  3. /**
  4. * Defines an interface for tour items.
  5. *
  6. * @see \Drupal\tour\Annotation\Tip
  7. * @see \Drupal\tour\TipPluginBase
  8. * @see \Drupal\tour\TipPluginManager
  9. * @see plugin_api
  10. */
  11. interface TipPluginInterface {
  12. /**
  13. * Returns id of the tip.
  14. *
  15. * @return string
  16. * The id of the tip.
  17. */
  18. public function id();
  19. /**
  20. * Returns label of the tip.
  21. *
  22. * @return string
  23. * The label of the tip.
  24. */
  25. public function getLabel();
  26. /**
  27. * Returns weight of the tip.
  28. *
  29. * @return string
  30. * The weight of the tip.
  31. */
  32. public function getWeight();
  33. /**
  34. * Returns an array of attributes for the tip wrapper.
  35. *
  36. * @return array
  37. * An array of classes and values.
  38. */
  39. public function getAttributes();
  40. /**
  41. * Used for returning values by key.
  42. *
  43. * @var string
  44. * Key of the value.
  45. *
  46. * @return string
  47. * Value of the key.
  48. */
  49. public function get($key);
  50. /**
  51. * Used for returning values by key.
  52. *
  53. * @var string
  54. * Key of the value.
  55. *
  56. * @var string
  57. * Value of the key.
  58. */
  59. public function set($key, $value);
  60. /**
  61. * Returns a renderable array.
  62. *
  63. * @return array
  64. * A renderable array.
  65. */
  66. public function getOutput();
  67. }