public function rss()
    {
        //This method works only for RSS
        is_true_or_fail($this->RequestHandler->prefers('rss'), ForbiddenException::class);

        $posts = $this->Posts->find('active')
            ->select(['title', 'preview', 'slug', 'text', 'created'])
            ->limit(getConfigOrFail('default.records_for_rss'))
            ->order([sprintf('%s.created', $this->Posts->getAlias()) => 'DESC'])
            ->cache('rss', $this->Posts->getCacheName());

        $this->set(compact('posts'));
    }
public function rss()
    {
        //This method works only for RSS
        is_true_or_fail($this->RequestHandler->prefers('rss'), ForbiddenException::class);

        $posts = $this->Posts->find('active')
            ->select(['title', 'preview', 'slug', 'text', 'created'])
            ->limit(getConfigOrFail('default.records_for_rss'))
            ->order([sprintf('%s.created', $this->Posts->getAlias()) => 'DESC'])
            ->cache('rss', $this->Posts->getCacheName());

        $this->set(compact('posts'));
    }
public function rss ( ) { //This method works only for RSS is_true_or_fail ( $ this -> RequestHandler -> prefers ( 'rss' ) , ForbiddenException :: class ) ; $ posts = $ this -> Posts -> find ( 'active' ) -> select ( [ 'title' , 'preview' , 'slug' , 'text' , 'created' ] ) -> limit ( getConfigOrFail ( 'default.records_for_rss' ) ) -> order ( [ sprintf ( '%s.created' , $ this -> Posts -> getAlias ( ) ) => 'DESC' ] ) -> cache ( 'rss' , $ this -> Posts -> getCacheName ( ) ) ; $ this -> set ( compact ( 'posts' ) ) ; }
Lists posts as RSS
@return void
@throws ForbiddenException
Lists posts as RSS