| @@ 241-256 (lines=16) @@ | ||
| 238 | * |
|
| 239 | * @return null|BlogTag |
|
| 240 | */ |
|
| 241 | public function getCurrentTag() |
|
| 242 | { |
|
| 243 | /** |
|
| 244 | * @var Blog $dataRecord |
|
| 245 | */ |
|
| 246 | $dataRecord = $this->dataRecord; |
|
| 247 | $tag = $this->request->param('Tag'); |
|
| 248 | if ($tag) { |
|
| 249 | $filter = URLSegmentFilter::create(); |
|
| 250 | ||
| 251 | return $dataRecord->Tags() |
|
| 252 | ->filter('URLSegment', [$tag, $filter->filter($tag)]) |
|
| 253 | ->first(); |
|
| 254 | } |
|
| 255 | return null; |
|
| 256 | } |
|
| 257 | ||
| 258 | /** |
|
| 259 | * Renders the blog posts for a given category. |
|
| @@ 287-302 (lines=16) @@ | ||
| 284 | * |
|
| 285 | * @return null|BlogCategory |
|
| 286 | */ |
|
| 287 | public function getCurrentCategory() |
|
| 288 | { |
|
| 289 | /** |
|
| 290 | * @var Blog $dataRecord |
|
| 291 | */ |
|
| 292 | $dataRecord = $this->dataRecord; |
|
| 293 | $category = $this->request->param('Category'); |
|
| 294 | if ($category) { |
|
| 295 | $filter = URLSegmentFilter::create(); |
|
| 296 | ||
| 297 | return $dataRecord->Categories() |
|
| 298 | ->filter('URLSegment', [$category, $filter->filter($category)]) |
|
| 299 | ->first(); |
|
| 300 | } |
|
| 301 | return null; |
|
| 302 | } |
|
| 303 | ||
| 304 | /** |
|
| 305 | * Get the meta title for the current action. |
|