I have this question to ask: How can I turn this url "/ company / personal / user / 8 / profile" (where 8 is the user ID) so that the "controller" is "company" and "action" instead "profile" or "edit" Or still "photo"? Thanks in advance
You could try something like this (I'm guessing that you are using cakephp 3.x):
Router::connect(
'/company/personal/user/:id/profile',
['controller' => 'Company', 'action' => 'profile'],
['id' => '\d+', 'pass' => ['id']]
);
OR
Router::connect(
'/company/personal/user/:id/*',
['controller' => 'Company'],
['id' => '\d+', 'pass' => ['id']]
);
OR UNDER A SCOPE
$routes->connect('/company/personal/user/:id/profile',
['controller' => 'Company', 'action' => 'profile'],
['id' => '\d+', 'pass' => ['id']]
);
As you can see we check for the id to be an integer. If it's not integer it won't call the binded action, it will return a 404.