Url->build fullbase option wont work


#1

Hello, Im trying to figure out whats wrong with my build url code using the fullbase option, its not working as described in the API:
https://api.cakephp.org/3.5/class-Cake.View.Helper.UrlHelper.html#_build

Using cake 3.5.12:

//option1
$this->Url->build([‘prefix’ => false, ‘controller’ => ‘reports’, ‘action’ => ‘results’, $report->id, $report->token], [‘fullBase’ => true, ‘escape’ => false]);
//generate : /reports/results/1853378873/o14Z0OGRqj
//option 2
$this->Url->build([‘prefix’ => false, ‘controller’ => ‘reports’, ‘action’ => ‘results’, $report->id, $report->token], true);
//generate : /reports/results/1853378873/o14Z0OGRqj

whats wrong with fullBase?


#2

Try:
echo $this->Url->build('/reports/results/'.$report->id.'/'.$report->token, true);

or
echo $this->Url->build('/reports/results/'.$report->id.'/'.$report->token, [‘fullBase’ => true, ‘escape’ => false]);


#3

and what string do you want?
also I don’t see “prefix” in this linked doc.


#4

I want the fullBase url:
http://mysite.com/reports/results/1853378873/o14Z0OGRqj

the prefix is part of Router class its used in the build() function, but i dont want the prefix in the url:
https://api.cakephp.org/3.5/source-class-Cake.View.Helper.UrlHelper.html#29-61