Indeed this can be achieved with custom route loader as @Onema said.
I can think of two other options, none of which do exactly what you wanted but may be of interest:
1. Creating a controller action which would just forward request to other actions
2. Using @Route annotation
1.
In AdminController create action:
public function adminAction($actionName)
{
return $this->forward('MyBundle:TargetController:' . $actionName);
}
2.
Annotation routing since it allows you to define routes without naming them. Name will be implicitly created by convention: Annotation routing.
Doesn't do exactly what you wanted but is pretty elegant too if you don't want to make custom route loader:
/**
* @Route("/admin/dosmt")
*/
public function dosmtAction()
{
return new Response('smtAction');
}
Additionally you can mount all controller actions on a prefix just like with YAML routing:
/**
* @Route("/admin")
*/
class MyController extends Controller
{
/**
* @Route("/dosmt")
*/
public function dosmtAction()
{
return new Response('smtAction');
}
}