database:'page/:pageurl' => 'page/view';
how to make do itHarro Verton wrote on Tuesday 7th of February 2012:Routes don't magically retrieve data from the database. If you want this, add a route'page/:pageurl' => 'page/view';
In your view() method, fetch the 'pageurl' param ( using $this->request()->param() );and do a database lookup.
controller/model/page.php
public function action_view($id = null)
{
$data['page'] = Model_Page::find($id);
$this->template->title = "Page";
$this->template->content = View::forge('page/view', $data);
}
In your view() method, fetch the 'pageurl' param ( using $this->request()->param() );and do a database lookup.
Harro Verton wrote on Tuesday 7th of February 2012:If I add that route here, and use $this->request()->param('pageurl'), I get the parameter returned without problems.
I will try again tomorrow $param = $this->request->param('pageurl');
It looks like you're new here. If you want to get involved, click one of these buttons!