Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
evsmash/articles / libs / Exts / Breadcrumbs.php
Size: Mime:
<?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;

	}

}