v1.php 937 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace zin;
  3. class tabPane extends wg
  4. {
  5. /**
  6. * @var mixed[]
  7. */
  8. protected static $defineProps = array(
  9. 'key?: string',
  10. 'title?: string',
  11. 'active?: bool=false',
  12. 'param?: string'
  13. );
  14. /**
  15. * @var mixed[]
  16. */
  17. protected static $defineBlocks = array(
  18. 'prefix' => array(),
  19. 'suffix' => array(),
  20. 'divider' => false
  21. );
  22. protected function created()
  23. {
  24. $key = $this->prop('key');
  25. if(is_null($key))
  26. {
  27. $key = $this->gid;
  28. $this->setProp('key', $key);
  29. }
  30. }
  31. protected function build()
  32. {
  33. $key = $this->prop('key');
  34. $active = $this->prop('active');
  35. return div
  36. (
  37. setID($key),
  38. setClass('tab-pane', $active ? 'active' : null),
  39. set($this->getRestProps()),
  40. $this->children()
  41. );
  42. }
  43. }