ENHANCEMENT: use UplocadField constructor combine with give the field allowedExtensions as array('jpg', 'git', 'png') to replace the SimpleImageField constructor

This commit is contained in:
Normann Lou 2012-06-30 00:47:50 +12:00
parent 0a4f22a08f
commit a2e3738f66

View File

@ -10,9 +10,11 @@ class TestFileUploadPage_Controller extends TestPage_Controller{
$fields = new FieldList(
new EmailField('Email', 'EmailField'),
new FileField('AFile','FileField'),
new SimpleImageField('AImage','SimpleImageField')
$aImage = new UploadField('AImage','SimpleImageField')
);
$aImage->allowedExtensions = array('jpg', 'gif', 'png');
$actions = new FieldList(
new FormAction('addMember', "Add a member with two Files uploaded")
);