Short answer : $this->dispatcher->getParam("YOUR_PARAM")
I define it manually for more control over the URI as so:
/* file = routes.php */
$router->add("/english", [
"namespace" => "Api\Controllers",
"module" => "Api",
'controller' => 'Language',
'action' => 'change',
/* one of my params */ 'language' => 'english'
]);
/* file = LanguageController.php */
<?php
namespace Api\Controllers;
use Phalcon\Mvc\Controller;
class LanguageController extends ControllerBase
{
public function ChangeAction()
{
// get the param passed in the routes
switch($this->dispatcher->getParam("language"))
{
case 'portuguese': $this->cookies->set("website_lang","pt"); break;
case 'english': $this->cookies->set("website_lang","en"); break;
}
$this->response->redirect("/");
}
}