v1.php 727 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace zin;
  3. class row extends wg
  4. {
  5. /**
  6. * @var mixed[]
  7. */
  8. protected static $defineProps = array(
  9. 'gap?: string|number',
  10. 'justify?: string',
  11. 'align?: string'
  12. );
  13. protected function build()
  14. {
  15. $classList = 'row';
  16. list($justify, $align, $gap) = $this->prop(array('justify', 'align', 'gap'));
  17. if(!empty($justify)) $classList .= ' justify-' . $justify;
  18. if(!empty($align)) $classList .= ' items-' . $align;
  19. return div
  20. (
  21. setClass($classList),
  22. is_numeric($gap) ? setClass("gap-$gap") : setStyle('gap', $gap),
  23. set($this->getRestProps()),
  24. $this->children()
  25. );
  26. }
  27. }