Where does this inscription - "My Yii Application" - come from in the very title of the page?

<title><?= Html::encode($this->title) ?></title> 

    2 answers 2

    The application name by default is written somewhere in the kernel.

    To set your own, you need to set a name in the config

     return [ .... 'name'=>'Your New Application Name!', ....other...info 

    and then in view you can write $this->title = Yii::$app->name; where the title will be taken from the config

    It can also be defaulted in index files, for example, for the basic application in views/site/index.php , and for the advanced version in backend/views/site/index.php and frontend/views/site/index.php respectively.

    • No no. But thanks anyway. This is the name of the page (title). It is taken for example from: views / site / index.php --- $ this-> title = 'My Yii Application'; --- - Yuri Svetlov
    • one
      @YuriSvetlov Yes, I looked, apparently from some version 2.0.6 they started to do that. Just in case, updated the answer for future users. - Alexey Shimansky

    The name is taken here: \vendor\yiisoft\yii2\base\Application.php in line 99: $name = 'My Yii Application'

    • 3
      Actually, it’s bad to change third-party library / framework files. - Qwertiy
    • one
      I fully agree with you, but you carefully read the question, and then evaluate the comments, I quote: "Where does this inscription -" My Yii Application "come from in the title of the page?" - Alexander Belsky