How can I implement advanced action routes (in routes.php)? We want to mask specific action routes in our project's routes.php file. Currently what we have looks like this:

return array(
    // /actions/api/element/section/name/{$name}/
    'api/test/(?P&lt;name&gt;)'  =&gt; ['action' =&gt; 'api/element/section'],
);


We would like to pass name into the action array somehow. Is there something documented or undocumented that I'm missing? Or is what I'm attempting not possible at this time?
Yes it’s possible. First you will need to update your route key so that you’re capturing the name parameter with a valid named subpattern. (You were close, but missing the actual pattern part of it).

return array(
    'api/test/(?P&lt;name&gt;[^\/]+)' =&gt; ['action' =&gt; 'api/element/section'],
);


Any named subpattern matches in your route will be passed to your controller action’s $variables argument, if it has one.

class Api_ElementController extends BaseController
{
    // ...

    public function actionSection(array $variables = array())
    {
        $name = $variables['name'];

        // ...
    }
}


Note that you specifically need to call the argument “$variables”, and you need to typeset it to an array for this to work.