moveItem() public method

Move item
public moveItem ( string $src, string $dest ) : void
$src string
$dest string
return void
Example #1
0
 public function moveAction()
 {
     $path = $this->parsePath();
     $dest = $this->_getParam('name');
     try {
         $files = (array) $this->_getParam('file', array());
         foreach ($files as $file) {
             $s = $this->service->moveItem("{$path}/{$file}", $dest);
             $this->_helper->flashMessenger->addMessage(getGS("Template '\$1' \$2.", $file, getGS('moved')));
         }
     } catch (\InvalidArgumentException $e) {
         $this->_helper->flashMessenger->addMessage(array('error', $e->getMessage()));
     }
     $this->_redirect(urldecode($this->_getParam('next')), array('prependBase' => false));
 }
 public function moveAction()
 {
     $translator = \Zend_Registry::get('container')->getService('translator');
     $path = $this->parsePath();
     $dest = $this->_getParam('name');
     try {
         $files = (array) $this->_getParam('file', array());
         foreach ($files as $file) {
             $s = $this->service->moveItem("{$path}/{$file}", $dest);
             $this->_helper->flashMessenger->addMessage($translator->trans("Template \$1 \$2.", array('$1' => $file, '$2' => $translator->trans('moved', array(), 'themes')), 'themes'));
         }
     } catch (\InvalidArgumentException $e) {
         $this->_helper->flashMessenger->addMessage(array('error', $e->getMessage()));
     }
     $this->_redirect(urldecode($this->_getParam('next')), array('prependBase' => false));
 }