findByRouteNameAndPreviewHash() public method

Finds the DvsPage by a route name and preview hash
public findByRouteNameAndPreviewHash ( string $name, string $previewHash ) : DvsPage
$name string
$previewHash string
return DvsPage
示例#1
0
 /**
  * Displays details of a page
  *
  * @return Response
  */
 public function show()
 {
     // what does it mean to be in editing mode? right now it is just when you are logged in
     $editing = !is_null(\Auth::user());
     //&& Input::get('editing', false);
     $pageVersionHash = $this->Input->get('page_version_share', null);
     $pageVersionName = $this->Input->get('page_version', null);
     $page = $pageVersionHash ? $this->PagesRepository->findByRouteNameAndPreviewHash($this->Route->currentRouteName(), $pageVersionHash) : $this->PagesRepository->findByRouteName($this->Route->currentRouteName(), $pageVersionName, $editing);
     $localized = $this->PagesRepository->findLocalizedPage($page);
     return $localized ? $this->Redirect->route($localized->route_name) : $this->retrieveResponse($page);
 }
示例#2
0
 /**
  * Displays details of a page
  *
  * @return Response
  */
 public function show()
 {
     // what does it mean to be in editing mode? right now it is just when you are logged in
     $editing = \DeviseUser::checkConditions('canUseDeviseEditor');
     //&& Input::get('editing', false);
     $pageVersionHash = $this->Input->get('page_version_share', null);
     $pageVersionName = $this->Input->get('page_version', null);
     $page = $pageVersionHash ? $this->PagesRepository->findByRouteNameAndPreviewHash($this->Route->currentRouteName(), $pageVersionHash) : $this->PagesRepository->findByRouteName($this->Route->currentRouteName(), $pageVersionName, $editing);
     $localized = $this->PagesRepository->findLocalizedPage($page);
     return $localized ? $this->retrieveLocalRedirect($localized) : $this->retrieveResponse($page);
 }