<?php
// 如果不使用默认的路由规则,请传入参数false
// 此时必需完全匹配路由表,否则调用默认的index/index
$router = new Phalcon\Mvc\Router(false);
// 如果URL以/结尾,删除这个/
$router->removeExtraSlashes(false);
// Not Found Paths
$router->notFound(['controller' => 'err', 'action' => 'notFound']);
//
$router->add('/:controller/:action/:params', [
    'namespace'  => 'SRVX\Api\Controllers',
    'controller' => 1,
    'action'     => 2,
    'params'     => 3,
]);

#------- 支付宝 -------
$router->add('/alipay/:controller/:action/:params', [
    'namespace'  => 'SRVX\Api\Controllers\Alipay',
    'controller' => 1,
    'action'     => 2,
    'params'     => 3,
]);

return $router;