File modules/template_engine/components/html/component_table/TableComponent.class.php

Last commit: Mon Mar 8 01:24:06 2021 +0100	Jan Dankert	New: Action menu on many lists; tables have now a fixed layout
1 <?php 2 3 namespace template_engine\components\html\component_table; 4 5 use template_engine\components\html\HtmlComponent; 6 use template_engine\element\CMSElement; 7 use template_engine\element\HtmlElement; 8 use template_engine\element\Value; 9 use template_engine\element\ValueExpression; 10 11 class TableComponent extends HtmlComponent 12 { 13 public $filter = true; 14 15 public function createElement() 16 { 17 $tableWrapper = (new HtmlElement('div'))->addStyleClass('table-wrapper'); 18 19 if ( $this->filter) 20 { 21 $filterInput = (new CMSElement('input'))->addStyleClass(['input','table-filter-input'])->addAttribute('type','search')->addAttribute('name','filter')->addAttribute('placeholder',Value::createExpression(ValueExpression::TYPE_MESSAGE,'SEARCH_FILTER')); 22 $filter = (new HtmlElement('div'))->addStyleClass('table-filter')->addChild( $filterInput ); 23 $tableWrapper->addChild($filter); 24 } 25 26 $tableContent = (new HtmlElement('div'))->addStyleClass('table-area'); 27 28 $table = (new CMSElement('table'))->addStyleClass('table'); 29 30 $tableWrapper->addChild( $tableContent->addChild( $table) ); 31 32 if ( $this->class) 33 $table->addStyleClass($this->class); 34 35 $this->adoptiveElement = $table; 36 37 return $tableWrapper; 38 } 39 }
Download modules/template_engine/components/html/component_table/TableComponent.class.php
History Mon, 8 Mar 2021 01:24:06 +0100 Jan Dankert New: Action menu on many lists; tables have now a fixed layout Mon, 9 Nov 2020 22:24:27 +0100 Jan Dankert New: Setting the CSS class of tables. Wed, 14 Oct 2020 22:36:29 +0200 Jan Dankert Refactoring: Fixed the namespace in component classes, now the are able to be load by the standard autoloader. Wed, 14 Oct 2020 22:20:22 +0200 Jan Dankert Refactoring: Renamed component folders, because 'if' is no valid namespace fragment.