File modules/template_engine/components/html/component_upload/UploadComponent.class.php
Last commit: Wed Oct 14 22:36:29 2020 +0200 Jan Dankert Refactoring: Fixed the namespace in component classes, now the are able to be load by the standard autoloader.
1 <?php 2 3 namespace template_engine\components\html\component_upload; 4 5 use template_engine\components\html\Component; 6 use template_engine\element\CMSElement; 7 8 class UploadComponent extends Component 9 { 10 public $size = 40; 11 public $name = ''; 12 public $multiple = false; 13 public $class = 'upload'; 14 public $maxlength = 0; 15 16 public function createElement() 17 { 18 $input = new CMSElement('input'); 19 $input->addAttribute('type','file'); 20 21 $input->addStyleClass( $this->class ); 22 23 if ( $this->multiple ) 24 $input->addAttribute( 'multiple','multiple' ); 25 26 //$input->addAttribute('id',REQUEST_ID.'_'.$this->name); 27 $input->addAttribute('name',$this->name); 28 $input->addAttribute('size',$this->size); 29 30 if ( $this->maxlength ) 31 $input->addAttribute( 'maxlength',$this->maxlength ); 32 33 return $input; 34 } 35 }
Downloadmodules/template_engine/components/html/component_upload/UploadComponent.class.php
History 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.