public function onStart() { $slug = $this->param('slug'); $this['post'] = Post::where('slug', '=', $slug)->isPublished()->first(); if (!$this['post']) { return Redirect::to('/404'); } $this->page->settings['title'] = $this["post"]->title; }