27 lines
583 B
PHP
27 lines
583 B
PHP
<?php namespace JasonWilliams\Feed\Components;
|
|
|
|
use Db;
|
|
use Cms\Classes\ComponentBase;
|
|
use JasonWilliams\Feed\Models\Tags;
|
|
|
|
class TagList extends ComponentBase
|
|
{
|
|
public function componentDetails()
|
|
{
|
|
return [
|
|
'name' => 'Tag List',
|
|
'description' => 'Displays a list of feed tags.'
|
|
];
|
|
}
|
|
|
|
public function defineProperties()
|
|
{
|
|
return [];
|
|
}
|
|
|
|
public function onRun()
|
|
{
|
|
$this->page['tags'] = Tags::groupBy('tag')->select(Db::raw('tag, count(*) as count'))->orderBy('count', 'desc')->get();
|
|
}
|
|
}
|