/** * Exection hook * * @param Stencil_Interface $controller Controller that initiated this class. */ public function execute(Stencil_Interface $controller) { $object = get_queried_object(); if (class_exists('Taxonomy', false)) { $controller->set('taxonomy', Taxonomy::get($object->taxonomy)); } else { $controller->set('taxonomy', $object); } }
function __construct() { parent::__construct(); $this->beforeFilter(function () { if (!Auth::check()) { return Redirect::to('auth'); } }); $this->taxonomy = Taxonomy::get('article'); }
function __construct() { parent::__construct(); $this->beforeFilter(function () { if (!Auth::check()) { return Redirect::to('auth'); } }); $this->taxonomy = Taxonomy::get('page'); Event::listen('page_attachment', function ($page) { echo View::make('sections.feed.attachment-page', array('post' => $page->toArray(), 'list' => Feed::orderBy('name', 'asc')->get())); }); }