Missing Controller not reading dropbox add function Cakephp Getting View Model not found -
i have follow code in controller, getting values dropbox chooser.
<?php class dropboxboxfilescontroller extends appcontroller { public function add() { if ($this->request->is('post')) { $this->request->input('json_decode'); $this->dropboxfile->create(); if ($this->dropboxfile->save($this->request->data)) { $this->session->setflash(__('your file has been liberated :)')); $this->redirect($this->referer()); } else { $this->session->setflash(__('something went wrong!')); } } }}?>
however, when getting error add function not exist when hit submit on submit button chooser.
i have tried several things nothing seems working far.
edit: view code
<?php echo $this->form->create('dropboxfile', array ('array' => 'file')); ?> <input type="dropbox-chooser" name="selected-file" style="visibility: hidden;"/> <?php echo $this->form->end('finish'); ?>
the dropbox code using https://www.dropbox.com/developers/dropins/chooser/js
edit
<form action="/cake/homes" array="file" id="dropboxfileindexform" method="post" accept- carset="utf-8"><div style="display:none;"><input type="hidden" name="_method" value="post"/></div><input type="dropbox-chooser" name="selected-file" style="visibility: hidden;"/> <div class="submit"><input type="submit" value="finish"/></div></form
you're using wrong format second argument in $this->form->create(). notice how, in parsed form element, has invalid 'array="file"' element , action not lead add action. try instead:
<?php echo $this->form->create( 'dropboxfile', array( 'url' => array('action' => 'add'), 'type' => 'file' ) ); ?>
Comments
Post a Comment