This is not how you should have done it in the first place, since such hardcoded URLs are very inflexible compared to arrays of URLs, where they are connected with routes that define the generated URLs at one point in your an application that allows you to easily make changes without applying modifications to the entire application.
As the saying goes, the magic $webroot missing (check the migration guide ), its value can be obtained directly through the View::$request object .
Instead, you should use Router::url() , UrlHelper or one of the HtmlHelper methods:
\Cake\Routing\Router::url(['controller' => 'Intro', 'action' => 'services', 1])
$this->Url->build(['controller' => 'Intro', 'action' => 'services', 1])
$this->Html->link('Title', ['controller' => 'Intro', 'action' => 'services', 1])
see also
source share