copyItem() 공개 메소드

Copy item
public copyItem ( string $src, string $dest ) : void
$src string
$dest string
리턴 void
예제 #1
0
 public function copyAction()
 {
     $path = $this->parsePath();
     $file = $this->_getParam('file');
     if (is_array($file)) {
         $file = array_shift($file);
     }
     try {
         $nameExt = pathinfo($this->_getParam('name'), PATHINFO_EXTENSION);
         $name = $this->formatName($this->_getParam('name'), $nameExt == '' ? pathinfo($file, PATHINFO_EXTENSION) : null);
         $this->service->copyItem("{$path}/{$file}", $name);
         $this->_helper->flashMessenger(getGS("Template '\$1' was duplicated into '\$2'.", $file, $name));
     } catch (\InvalidArgumentException $e) {
         $this->_helper->flashMessenger(array('error', $e->getMessage()));
     }
     $this->_redirect(urldecode($this->_getParam('next')), array('prependBase' => false));
 }
예제 #2
0
 public function copyAction()
 {
     $translator = \Zend_Registry::get('container')->getService('translator');
     $path = $this->parsePath();
     $file = $this->_getParam('file');
     if (is_array($file)) {
         $file = array_shift($file);
     }
     try {
         $nameExt = pathinfo($this->_getParam('name'), PATHINFO_EXTENSION);
         $name = $this->formatName($this->_getParam('name'), $nameExt == '' ? pathinfo($file, PATHINFO_EXTENSION) : null);
         $this->service->copyItem("{$path}/{$file}", $name);
         $this->_helper->flashMessenger($translator->trans("Template \$1 was duplicated into \$2.", array('$1' => $file, '$2' => $name), 'themes'));
     } catch (\InvalidArgumentException $e) {
         $this->_helper->flashMessenger(array('error', $e->getMessage()));
     }
     $this->_redirect(urldecode($this->_getParam('next')), array('prependBase' => false));
 }