Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6626855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:56:37+00:00 2026-05-25T21:56:37+00:00

When I do print_r(Yii::app()->request->baseUrl) I get an empty string. A post on the Yii

  • 0

When I do

print_r(Yii::app()->request->baseUrl)

I get an empty string. A post on the Yii forum says this is blank by default. How can I change its default value so that I can use absolute URLs?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:56:37+00:00Added an answer on May 25, 2026 at 9:56 pm

    As the post in that forum says, it might be different for different platforms, or if the web app isnt located in the default folder.
    All these things work for me:

    echo Yii::app()->request->baseUrl."<br/>" ;
    print_r(Yii::app()->request->baseUrl);
    echo "<br/>";
    var_dump(Yii::app()->getBaseUrl(true));
    echo "<br/>";
    echo Yii::app()->request->getBaseUrl(true);
    

    I used yiic to create the web app, with default settings using the following command in a terminal, yiic webapp /path/to/webapp
    So that generates the necessary directory structure for the web app, and also the default skeleton files. Try it and then see how it works.
    I’m new to yii myself.

    Edit:

    This solution might have worked for the op, but the correct way baseUrl can be set is shown by ecco’s answer to this question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this from print_r($data) : Array ( [0] => Array ( [0] =>
I can print the session values in codeigniter by print_r($this->session->userdata); How can I print
when i print print_r($node) in the node.tpl.php. i get this. taxonomy] => Array (
When I send over post data I do a print_r($_POST); and I get something
I have an array value like this. My print_r($_POST) looks like this. I can
I have tried the following but it is giving me errors: print_r($this->session->userdata()); How can
When I do a print_r on a php variable I get this. This is
How can I turn this array: print_r($arr) Array ( [131] => stdClass Object (
I get this array when I print_r($_POST) , from the below result I want
Is there a way to get PHP-like print_r(object) funcionality in iPython? I know I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.