public function edit($id) { if (!($fnbgallery = FnbGallery::findById($id))) { Flash::set('error', __('Image is not found!')); redirect(get_url('fnbgallery')); } // check if trying to save if (get_request_method() == 'POST') { return $this->_edit($id); } $this->display('fnbgallery/view', array('fnbgallery' => $fnbgallery)); }