public function rss($criteria)
    {
        $this->loadModel('Content.Contents');

        try {
            $contents = $this->Contents
                ->search($criteria)
                ->limit(10);
        } catch (\Exception $e) {
            $contents = [];
        }

        $this->set(compact('contents', 'criteria'));
        $this->viewMode('rss');
        $this->RequestHandler->renderAs($this, 'rss');
        $this->RequestHandler->respondAs('xml');
    }
public function rss($criteria)
    {
        $this->loadModel('Content.Contents');

        try {
            $contents = $this->Contents
                ->search($criteria)
                ->limit(10);
        } catch (\Exception $e) {
            $contents = [];
        }

        $this->set(compact('contents', 'criteria'));
        $this->viewMode('rss');
        $this->RequestHandler->renderAs($this, 'rss');
        $this->RequestHandler->respondAs('xml');
    }
public function rss ( $ criteria ) { $ this -> loadModel ( 'Content.Contents' ) ; try { $ contents = $ this -> Contents -> search ( $ criteria ) -> limit ( 10 ) ; } catch ( \ Exception $ e ) { $ contents = [ ] ; } $ this -> set ( compact ( 'contents' , 'criteria' ) ) ; $ this -> viewMode ( 'rss' ) ; $ this -> RequestHandler -> renderAs ( $ this , 'rss' ) ; $ this -> RequestHandler -> respondAs ( 'xml' ) ; }
RSS feeder.

Similar to `ServeController::search()` but it uses `rss` layout instead of
default layout.

@param string $criteria A search criteria. e.g.: `"this phrase" -"but not this" OR -hello`
@return void
RSS feeder .