Table.php 523 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Dcat\Admin\Form\Field;
  3. use Dcat\Admin\Admin;
  4. class Table extends ArrayField
  5. {
  6. /**
  7. * @var string
  8. */
  9. protected $viewMode = 'table';
  10. public function render()
  11. {
  12. if (! $this->shouldRender()) {
  13. return '';
  14. }
  15. Admin::style(
  16. <<<'CSS'
  17. .table-has-many .fields-group .form-group {
  18. margin-bottom:0;
  19. }
  20. .table-has-many .fields-group .form-group .remove {
  21. margin-top: 10px;
  22. }
  23. CSS
  24. );
  25. return $this->renderTable();
  26. }
  27. }