Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

50 lines (42 sloc) 1.14 KB
class routes extends mpmvcRouter
//add custom route handlers and override defaults here
public function home()
echo 'overriding home route';
public function about()
echo 'heres an about page';
public function showPerson()
$id = $this->get('PARAMS["id"]');
$person= new Person();
$micropost = new Micropost();
$instance = $person->load($id);
$output = $person->renderItem($id, 'personView');
$posts = $micropost->find('Person_id', $id);
$postlist = '';
foreach($posts as $post)
$postlist .= $output->copy('micropost')
->replace('base_url', $this->app->baseurl)
->replace('pid', $post->id)
->replace('ptitle', $post->title);
echo $this->app->render($output->replace('micropost', $postlist));
$app->setRoutesHandler(new routes());
//define additional routes here
'GET /about' => 'about',
'GET /people/@id' => 'showPerson'
Jump to Line
Something went wrong with that request. Please try again.