v1.php 849 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace zin;
  3. class fragment extends wg
  4. {
  5. /**
  6. * @var mixed[]
  7. */
  8. protected static $defineProps = array
  9. (
  10. 'rawContent?: bool',
  11. 'hookContent?: bool'
  12. );
  13. protected function build()
  14. {
  15. $context = context();
  16. $css = array(data('pageCSS'), '/*{{ZIN_PAGE_CSS}}*/');
  17. $js = array('/*{{ZIN_PAGE_JS}}*/', data('pageJS'));
  18. $rawContent = $this->prop('rawContent', !$context->rawContentCalled);
  19. $hookContent = $this->prop('hookContent', !$context->hookContentCalled);
  20. return array
  21. (
  22. h::css($css, setClass('zin-page-css')),
  23. $this->children(),
  24. $rawContent ? rawContent() : null,
  25. $hookContent ? hookContent() : null,
  26. h::js($js, setClass('zin-page-js'))
  27. );
  28. }
  29. }