'/(int)year/(int)month/(int)day/(int)title', ); // deal with wordpress custom pages, such as 'about', 'resume', etc. $pages = $this->getFinder('posts')->findVisiblePages(); // go through the dynamic pages and add them as routes. __call will be // called when these routes are accessed foreach($pages as $page) { $routes[$page->post_name] = '/'. $page->post_name; } return $routes; } // default action public function index(Request $request, Response $response) { // viewing a single entry because the permalink is present if($request['year']) { // viewing all posts } else { $response['posts'] = $this->getFinder('posts')->findAllVisible(1, $this['posts_per_page']); $response['main'] = 'posts.html'; } } // allow for variable route names as per defined in getRoutes from // the database pages that were added, eg: wordpress' "about" page public function __call($fn, array $args = array()) { } }