public function renameAction()
{
$translator = \Zend_Registry::get('container')->getService('translator');
$path = $this->parsePath();
$file = $this->_getParam('file');
if (is_array($file)) {
$file = array_shift($file);
}
try {
$name = $this->formatName($this->_getParam('name'), null);
$this->service->renameItem("{$path}/{$file}", $name);
$this->clearCompiledTemplate("{$path}/{$file}");
$this->_helper->flashMessenger($translator->trans("Template object \$1 was renamed to \$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));
}