CakePHP ZipArchive undedifined method

2015-05-18 Thread papalifegr
I want to type

class ZipController extends AppController {

$folder_path = 'c:/Testaufgabe';
$zip_name = 'c:/my_zipped_file.zip'; // to simiou kai to onoma tou arxeiou pou 
tha apothikeuti

public function upload(){
$za = new ZipArchive();
$res = $za-open($zip_name, ZipArchive::CREATE);

if($res === TRUE){  
//$za-addFile($folder_path , basename($folder_path ));   // edo 
gia deuteri parametro theloume to onoma mono tou arxeiou
$za-addDir($folder_path, basename($folder_path));
$za-close();
} 
else  { 
echo 'Could not create a zip archive';
}   }



public function addDir($path, $root){
//   $za-addEmptyDir($root);
//echo 'ok';
   // $this-addDirDo($path, $root, $za);
}}

But when I call $za-addDir($folder_path, basename($folder_path));

it says that Call to undefined method ZipArchive::addDir()

I would like to have some help please

I use CAKEPHP V3

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Form width fieldset and different button types

2015-05-18 Thread Sam Clauw
Hi there!

I'm trying to use the jquery file uploader 
https://github.com/blueimp/jQuery-File-Upload/wiki in combination with 
CakePHP.

The HTML form uses 3 different button types:

   - submit (button type=submitStart upload/submit)
   - reset (button type=resetStart upload/submit)
   - button (button type=buttonStart upload/submit)

With CakePHP, I try to create those buttons via $this-Form-inputs, but I 
don't find out how I should sum up those different type of inputs.

I tried the following, but it ends up that those buttons are becoming input 
fields instead:

echo $this-Form-create('OutletPhoto', array(
'type' = 'file',
'novalidate' = true, // browser validatie
'inputDefaults' = array(
'label' = true,
'div' = 'form-group',
'class' = 'form-control'
),
'role' = 'form'
));

echo $this-Form-inputs(array(
'legend' = false,
'name' = array(
'type' = 'file',
'multiple',
'label' = false,
'id' = 'file_upload',
'name' = 'file_upload',
'class' = false,
'before' = 'Pick photos',
'after' = ''
),
'Start upload' = array(
'type' = 'submit',
'label' = false,
'class' = 'btn btn-primary start'
),
'Cancel upload' = array(
'type' = 'reset',
'label' = false,
'class' = 'btn btn-warning cancel'
),
'Delete' = array(
'type' = 'button',
'label' = false,
'class' = 'btn btn-danger delete'
)
));

echo $this-Form-end('Save');

Here's the HTML output of this code:

div class=form-groupdiv class=submit*input class=btn btn-primary 
start type=submit value=Start upload*/div/div
div class=form-group*input name=data[OutletPhoto][Cancel upload] 
class=btn btn-warning cancel type=reset id=OutletPhotoAnnuleerUpload*
/div
div class=form-groupbutton class=btn btn-danger delete 
type=submitDelete/button/div

Anyone who can tell me why my Start upload and Cancel upload don't show up 
as a button? Thanks in advance! ;)

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.