[TYPO3-mvc] 404 redirect if requested object doesn't exist? show action

ralph 77 at kubai.de
Wed Apr 21 14:14:16 CEST 2010


hi. i wonder how i can redirect to a 404 page if the requested object 
doesn't exist. like if a post from the blog ws deleted but a website 
visitor calls an old bookmarked link.
have no clue how to deal with the exeption...
/**
	 * Action that displays one single post
	 *
	 * @param Tx_BlogExample_Domain_Model_Post $post The post to display
	 * @param Tx_BlogExample_Domain_Model_Comment $newComment A new comment
	 * @dontvalidate $newComment
	 * @return string The rendered view
	 */
	public function showAction(Tx_BlogExample_Domain_Model_Post $post, 
Tx_BlogExample_Domain_Model_Comment $newComment = NULL) {
		$this->view->assign('post', $post);
		$this->view->assign('newComment', $newComment);
	}


More information about the TYPO3-project-typo3v4mvc mailing list