Our old website CSS was set up so that the body tag had an id of the controller name and a class of the action name, using Zend Framework 1. Now we\'re switchi
body
To get something like PostController try following ...
preg_match('/([a-z]*)@/i', $request->route()->getActionName(), $matches); $controllerName = $matches[1];
$matches[1] includes the first group while $matches[0] includes everything matched. So also the @ which isn't desired.