I am using the below code in my Controller file to generate full site URL
$this->Url->build(['controller' => 'home', 'action' => 'index'], true);.
But I am getting a "Call to a member function build() on boolean" error. The reason why I am not using
Router::URL(['controller' => 'home', 'action' => 'index']);
is I don't want a relative URL. Can't I use Url builder in the controller?
I think, the main reason of your Error is wrong name of Controller.
First,Name Conventions says
so your file name must be like
HomesController.php. Next the Class name should be like thisHomesController.Secondly, for CakePHP character size matters. If you want build URL to your controller you have to do like this
$this->Url->build(['controller' => 'Home', 'action' => 'index'], true);Where controller name should be capitalize.
More about building URL in CakePHP