public function preview($slug = null)
    {
        $page = $this->Pages->findPendingBySlug($slug)
            ->contain([$this->Pages->Categories->getAlias() => ['fields' => ['title', 'slug']]])
            ->firstOrFail();

        $this->set(compact('page'));
        $this->render('view');
    }
public function preview($slug = null)
    {
        $page = $this->Pages->findPendingBySlug($slug)
            ->contain([$this->Pages->Categories->getAlias() => ['fields' => ['title', 'slug']]])
            ->firstOrFail();

        $this->set(compact('page'));
        $this->render('view');
    }
public function preview ( $ slug = null ) { $ page = $ this -> Pages -> findPendingBySlug ( $ slug ) -> contain ( [ $ this -> Pages -> Categories -> getAlias ( ) => [ 'fields' => [ 'title' , 'slug' ] ] ] ) -> firstOrFail ( ) ; $ this -> set ( compact ( 'page' ) ) ; $ this -> render ( 'view' ) ; }
Preview for pages.
It uses the `view` template.
@param string $slug Page slug
@return void
Preview for pages . It uses the view template .