Is there a specific reason you're using :param instead of giving your variable a descriptive name such as "username"?
Take a look here for more info on supported placeholders https://docs.phalcon.io/en/latest/reference/routing.html#defining-routes
In any case, have you tried this syntax?
$router->add( '/user/{username}', array( 'controller' => 'user', 'action' => 'username') ); // Option 1
//or
$router->add( '/user/{param}', array( 'controller' => 'user', 'action' => 'username') ); // Option 2
Then in the controller just reference the username like so:
$username = $this->dispatcher->getParam('username'); // Use with Option 1 from above
// or - Depending on the method above
$username = $this->dispatcher->getParam('param'); // Use with Option 2 from above
For adding more URLs, you should be able to do so like this:
$router->add( '/user/{username}/settings', array( 'controller' => 'user', 'action' => 'settings') );
/**
* The in the controller get the param values like so:
* $username = $this->dispatcher->getParam('username');
*/
// And for specific settings
$router->add( '/user/{username}/settings/{setting_name}', array( 'controller' => 'user', 'action' => 'specificSetting') );
/**
* The in the controller get the param values like so:
* $username = $this->dispatcher->getParam('username');
* $setting_name = $this->dispatcher->getParam('setting_name');
*/
Also, as your application grows, it would be a good idea to start naming your routes:
$router->add( '/user/{username}/settings',
array(
'controller' => 'user',
'action' => 'settings'
)
)->setName('user_settings');
Then in your views you can use the url function (Volt Example):
<a href="{{ url(['for' : 'user_settings','username' : user.getUsername() ]) }}">{{ user.getUsername() }}</a>
If you pass the user object/model from the controller to the view, this will render <a href="/user/my_username/settings">my_username</a>
So later on if you change your URL for that route, your application will automatically render the new URL without you having to update anything else.