/** * Add home route to given router * * @param Router $router */ public function addTo(Router $router) { $router->addGet('home', '/')->setValues(array('action' => 'home.index'))->setAccept(array('application/json', 'text/html')); }
/** * Add poll routes to given router * * @param Router $router */ public function addTo(Router $router) { $router->addGet('poll.get', '/poll/{id}')->setValues(array('action' => 'poll.get'))->addTokens(array('id' => Uuid::VALID_PATTERN))->setAccept(array('application/json', 'text/html')); $router->addPost('poll.create', '/poll/create')->setValues(array('action' => 'poll.create'))->setAccept(array('application/json', 'text/html')); }