$url = $this->Url->build([
"controller" => "Posts",
"action" => "search",
"?" => ["foo" => "bar"]
],true);
Method 2: Use the Router
use Cake\Routing\Router;
$url = Router::url([
'controller' => 'Posts',
'action' => 'search',
'?' => ['foo' => $bar]
], true);
If you are a bloguru member, please login.
Login
If you are not a bloguru member, you may request a free account here:
Request Account