HtmlBlockInterface.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /**
  3. * @package Grav\Framework\ContentBlock
  4. *
  5. * @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
  6. * @license MIT License; see LICENSE file for details.
  7. */
  8. namespace Grav\Framework\ContentBlock;
  9. /**
  10. * Interface HtmlBlockInterface
  11. * @package Grav\Framework\ContentBlock
  12. */
  13. interface HtmlBlockInterface extends ContentBlockInterface
  14. {
  15. /**
  16. * @return array
  17. */
  18. public function getAssets();
  19. /**
  20. * @return array
  21. */
  22. public function getFrameworks();
  23. /**
  24. * @param string $location
  25. * @return array
  26. */
  27. public function getStyles($location = 'head');
  28. /**
  29. * @param string $location
  30. * @return array
  31. */
  32. public function getScripts($location = 'head');
  33. /**
  34. * @param string $location
  35. * @return array
  36. */
  37. public function getHtml($location = 'bottom');
  38. /**
  39. * @param string $framework
  40. * @return $this
  41. */
  42. public function addFramework($framework);
  43. /**
  44. * @param string|array $element
  45. * @param int $priority
  46. * @param string $location
  47. * @return bool
  48. *
  49. * @example $block->addStyle('assets/js/my.js');
  50. * @example $block->addStyle(['href' => 'assets/js/my.js', 'media' => 'screen']);
  51. */
  52. public function addStyle($element, $priority = 0, $location = 'head');
  53. /**
  54. * @param string|array $element
  55. * @param int $priority
  56. * @param string $location
  57. * @return bool
  58. */
  59. public function addInlineStyle($element, $priority = 0, $location = 'head');
  60. /**
  61. * @param string|array $element
  62. * @param int $priority
  63. * @param string $location
  64. * @return bool
  65. */
  66. public function addScript($element, $priority = 0, $location = 'head');
  67. /**
  68. * @param string|array $element
  69. * @param int $priority
  70. * @param string $location
  71. * @return bool
  72. */
  73. public function addInlineScript($element, $priority = 0, $location = 'head');
  74. /**
  75. * @param string $html
  76. * @param int $priority
  77. * @param string $location
  78. * @return bool
  79. */
  80. public function addHtml($html, $priority = 0, $location = 'bottom');
  81. }