public function preview($id = null)
    {
        $photo = $this->Photos->findPendingById($id)
            ->select(['id', 'album_id', 'filename'])
            ->contain([$this->Photos->Albums->getAlias() => ['fields' => ['id', 'title', 'slug']]])
            ->firstOrFail();

        $this->set(compact('photo'));
        $this->render('view');
    }
public function preview($id = null)
    {
        $photo = $this->Photos->findPendingById($id)
            ->select(['id', 'album_id', 'filename'])
            ->contain([$this->Photos->Albums->getAlias() => ['fields' => ['id', 'title', 'slug']]])
            ->firstOrFail();

        $this->set(compact('photo'));
        $this->render('view');
    }
public function preview ( $ id = null ) { $ photo = $ this -> Photos -> findPendingById ( $ id ) -> select ( [ 'id' , 'album_id' , 'filename' ] ) -> contain ( [ $ this -> Photos -> Albums -> getAlias ( ) => [ 'fields' => [ 'id' , 'title' , 'slug' ] ] ] ) -> firstOrFail ( ) ; $ this -> set ( compact ( 'photo' ) ) ; $ this -> render ( 'view' ) ; }
Preview for photos.
It uses the `view` template.
@param string $id Photo ID
@return \Cake\Network\Response|null|void
Preview for photos . It uses the view template .