<?=Yii::$app->request->baseUrl?>
The code mentioned above does not work for me n YII2 Framework, however, if I use var_dumpfor verification, it returns Empty String
var_dump
try it
<?= \Yii::$app->request->url; ?>
Have you tried using the url helper?
<?php use yii\helpers\Url; // Relative base url echo Url::base(); // Absolute base url echo Url::base(true) ?>
Or if this is the home URL you are after ...
<?php use yii\helpers\Url; // Relative base url echo Url::home(); // Absolute base url echo Url::home(true) ?>
Source: https://habr.com/ru/post/1612422/More articles:run chroot in docker - dockerHow to declare a method of a Delphi object called from a script with an argument of a procedure type - delphiIntegration of InMobi Ad in Android - androidPHP preg_replace between string and quotation marks - phpHow to make a PHP form work in modal - htmlDeep binding to Android and iOS applications on Facebook - androidProblem with Plone 5 plone.app.ldap - ploneReceive notification when an indexed log entry changes in another tab - javascript-eventsOracle Query Optimizing complex delete query - sqlSys.Date () shows wrong date in brilliant applications - rAll Articles