public function BlogEntryForm() { $postId = 0; if ($this->request->latestParam('ID')) { $postId = (int) $this->request->latestParam('ID'); } /* * I add the ($postID == 0) control for manage the edit form submit * in the front-end blog template */ if ($this->canEditFrontEndBlogEntry($postId) || $postId == 0) { return parent::BlogEntryForm(); } $page = DataObject::get_by_id('BlogEntry', $postId); if ($page) { $this->redirect($page->Link()); } }
public function init() { parent::init(); }