public function getCurrentCategory()
    {
        /**
         * @var Blog $dataRecord
         */
        $dataRecord = $this->dataRecord;
        $category = $this->request->param('Category');
        if ($category) {
            $filter = URLSegmentFilter::create();
            // url encode unless it's multibyte (already pre-encoded in the database)
            // see https://github.com/silverstripe/silverstripe-cms/pull/2384
            if (!$filter->getAllowMultibyte()) {
                $category = rawurlencode($category);
            }

            return $dataRecord->Categories()
                ->filter('URLSegment', $category)
                ->first();
        }
        return null;
    }
public function getCurrentCategory()
    {
        /**
         * @var Blog $dataRecord
         */
        $dataRecord = $this->dataRecord;
        $category = $this->request->param('Category');
        if ($category) {
            $filter = URLSegmentFilter::create();
            // url encode unless it's multibyte (already pre-encoded in the database)
            // see https://github.com/silverstripe/silverstripe-cms/pull/2384
            if (!$filter->getAllowMultibyte()) {
                $category = rawurlencode($category);
            }

            return $dataRecord->Categories()
                ->filter('URLSegment', $category)
                ->first();
        }
        return null;
    }
public function getCurrentCategory ( ) { /**
         * @var Blog $dataRecord
         */ $ dataRecord = $ this -> dataRecord ; $ category = $ this -> request -> param ( 'Category' ) ; if ( $ category ) { $ filter = URLSegmentFilter :: create ( ) ; // url encode unless it's multibyte (already pre-encoded in the database) // see https://github.com/silverstripe/silverstripe-cms/pull/2384 if ( ! $ filter -> getAllowMultibyte ( ) ) { $ category = rawurlencode ( $ category ) ; } return $ dataRecord -> Categories ( ) -> filter ( 'URLSegment' , $ category ) -> first ( ) ; } return null ; }
Category Getter for use in templates.

@return null|BlogCategory
Category Getter for use in templates .