Created
May 23, 2011 19:35
-
-
Save eminetto/987385 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//faz a exclusão de um post | |
public function delAction() { | |
$session = Zend_Registry::get('session'); | |
$id = $this->_getParam('id'); | |
if(!$id) { //não foi passado um id | |
$session->erro = 'Não foi selecionado ID'; | |
$this->_redirect('/admin/admin'); //redireciona para a página inicial | |
exit; | |
} | |
$posts = new Posts(); | |
$posts->delete("id = $id"); | |
$session = Zend_Registry::get('session'); | |
$session->erro ="Post $id excluído com sucesso"; | |
$this->_redirect('/admin/admin'); //redireciona para a página inicial | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment