PHP Classes

File: template/Code/file-input-filter

Recommend this page to a friend!
  Classes of Fabrice Fesch   Melis Tool Creator   template/Code/file-input-filter   Download  
File: template/Code/file-input-filter
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Melis Tool Creator
Module for the Melis CMS to create tools
Author: By
Last change:
Date: 1 year ago
Size: 645 bytes
 

Contents

Class file image Download
private function fileInput($elemName, $formFilter) { $target = $_SERVER['DOCUMENT_ROOT'].'/media/ModuleTpl/'; if (!is_dir($target)) mkdir($target, 0777); // File Input $fileInput = new \Laminas\InputFilter\FileInput($elemName); $fileInput->setRequired(true); $fileInput->getFilterChain()->attachByName( 'filerenameupload', [ 'target' => $target.'/ModuleTpl', // File name prefix 'randomize' => true, 'use_upload_extension' => true, ] ); $formFilter->add($fileInput); }