Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Set hostInfo and baseUrl

$
0
0
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

'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

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>