Repository URL to install this package:
|
Version:
3.2.3 ▾
|
<?php
namespace Evsmash\Articles\Exts;
use Evsmash\Core\Input\Route;
class Breadcrumbs {
public $element = false;
public $data = [];
// articles index
public function articlesIndex() {
$this->data[Route::map('evsmash/articles/articles/index')] = t('Articles');
}
// articles type
public function articlesType() {
$this->data[Route::map('evsmash/articles/articles/index')] = t('Articles');
$this->data[$this->element->link] = $this->element->name;
}
// articles category
public function articlesCategory() {
$this->data[Route::map('evsmash/articles/articles/index')] = t('Articles');
$this->data[$this->element->link] = $this->element->name;
}
// articles promoted
public function articlesPromoted() {
$this->data[Route::map('evsmash/articles/articles/index')] = t('Articles');
$this->data[Route::map('evsmash/articles/articles/promoted')] = t('Promoted articles');
}
// articles show
public function articlesShow() {
// categories
$categories = $this->element->categories->sortBy('lft')->where('published', 1);
// data
$this->data[Route::map('evsmash/articles/articles/index')] = t('Articles');
foreach($categories as $cat) {
$this->data[$cat->link] = $cat->name;
}
$this->data[$this->element->link] = $this->element->name;
}
}