Hi,
I'm trying to generate absolute urls in a console application. Qiang said I need to set the request->hostInfo and request->baseUrl properties.
This is what my console config looks like
The absolute URL I need to generate is
Any ideas of how to setup hostInfo and baseUrl correctly for a console app?
Cheers,
Matt
I'm trying to generate absolute urls in a console application. Qiang said I need to set the request->hostInfo and request->baseUrl properties.
This is what my console config looks like
'request' => array(
'hostInfo' => 'https://localhost',
'baseUrl' => '/project_browser/html/cp.host4hope.com',
),
The absolute URL I need to generate is
'https://localhost/project_browser/html/cp.host4hope.com/index-local.php/user/verify/code/{$verification_code}'
echo Yii::app()->createAbsoluteUrl('user/verify', array('code' => $verification_code));
//outputs
//Notice the reference to the yiic console script file.
'https://localhostC:\xampplite\htdocs\project_browser\code\private\yiic.php?r=user/verify&code=df35da088053ec704a3d58405c0a8818'
Any ideas of how to setup hostInfo and baseUrl correctly for a console app?
Cheers,
Matt