Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php defined('C5_EXECUTE') or die('Access Denied.');
- class JobController extends Controller {
- private $path;
- public function on_start() { // do not use __construct()
- // BEST way to get the path in a controller?
- $this->path = Page::getCurrentPage()->getCollectionPath();
- // $this->path = $this->getCollectionObject()->getCollectionPath();
- // $this->path = Loader::helper('navigation')->getLinkToCollection(Page::getCurrentPage()); // adds slash
- // $this->path = View::url('job'); // adds trailing slash, and requires the name of the view :(
- // global $c; $this->path = $c->getCollectionPath(); // global, feh
- }
Advertisement
Add Comment
Please, Sign In to add comment