Search
 
SCRIPT & CODE EXAMPLE
 

PHP

silverstripe image upload field

  public function getCMSFields()
  {
        $fields = parent::getCMSFields();
        $fields->addFieldToTab('Root.Attachments',
             UploadField::create('Photo'));
        $fields->addFieldToTab('Root.Attachments',
            $brochure = UploadField::create(
                'Brochure',
                'Travel brochure,
                optional (PDF only)'
        ));
        $brochure->getValidator()
            ->setAllowedExtensions(['pdf']);
        return $fields;
  }
Comment

PREVIOUS NEXT
Code Example
Php :: Update page template and remove page editor in wordpress 
Php :: twig to pdf 
Php :: get percentage rating in laravel 
Php :: Convert an Array to a String in PHP 
Php :: laravel view routes 
Php :: sqlsrv select 
Php :: laravel longblob migration 
Php :: laravel dirty words check 
Php :: php include file from another folder 
Php :: Laravel Nested whenLoaded 
Php :: user order by role spatie laravel 
Php :: cut pice of text in laravel 
Php :: php get today at 3pm 
Php :: php md5 password is insecure 
Php :: check mobile number length in php 
Php :: php ref parameter 
Php :: heroku deploy php 
Php :: 1 to many relationship in laravel 
Php :: xss=removed 
Php :: Route [login] not defined.Route [login] not defined. 
Php :: php mysqli date between 
Php :: PHP str_ends_with — Checks if a string ends with a given substring 
Php :: Laravel Unique Multiple Column validation 
Php :: laravel schedule kernel code sample 
Php :: artisan app name 
Php :: php catch fatal error 
Php :: change apply coupon text woocommerce 
Php :: make model factory and controller laravel 
Php :: php last of string till / 
Php :: php pass function as callback 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =