createFile() public method

Create file
public createFile ( string $name ) : void
$name string
return void
Example #1
0
 public function createFileAction()
 {
     $path = $this->parsePath();
     $name = $this->formatName($this->_getParam('name'));
     try {
         $this->service->createFile(ltrim("{$path}/{$name}", ' /'));
         $this->_helper->flashMessenger(getGS("New template '\$1' created.", $name));
     } catch (\InvalidArgumentException $e) {
         $this->_helper->flashMessenger(array('error', $e->getMessage()));
     }
     $this->_redirect(urldecode($this->_getParam('next')), array('prependBase' => false));
 }
 public function createFileAction()
 {
     $translator = \Zend_Registry::get('container')->getService('translator');
     $path = $this->parsePath();
     $name = $this->formatName($this->_getParam('name'));
     try {
         $this->service->createFile(ltrim("{$path}/{$name}", ' /'));
         $this->_helper->flashMessenger($translator->trans("New template \$1 created.", array('$1' => $name), 'themes'));
     } catch (\InvalidArgumentException $e) {
         $this->_helper->flashMessenger(array('error', $e->getMessage()));
     }
     $this->_redirect(urldecode($this->_getParam('next')), array('prependBase' => false));
 }