Yii2 Change name "My Yii Application"


(Shahzadthathal) #1

How I can change Yii2 application name"My Yii Application"

Where I update this code of line?

Yii::$app->name


(Mmbalasundaram) #2

update your code in views/layouts/main.php

By default line no 34




            NavBar::begin([

                'brandLabel' => Yii::$app->name,



Add below code in web.php




$config = [

    'id' => 'basic',

	'name'=>'Test App',




(abed el salam) #3

from config, change id.

in basic: web.php, change id


#4

To correctly change the name of your app you need to edit the config/main.php (if your using the advanced app you will need to change the frontend and backbend config/main.php files).




<?php

return [

	'id' => 'app-frontend',

'name'=>'Your New Name!',

....other...info



Other items you can configer in the main.php file

Then you can use it wherever with


Yii::$app->name


(Shahzadthathal) #5

I have installed yii2 basic. I changed name in web.php but nothing happened.


(Shahzadthathal) #6

Working now … !!




<?php

return [

        'id' => 'basic',

'name'=>'Your New Name!',

....other...info




(Spiritfaer) #7

And what you have done for that new result? :face_with_raised_eyebrow: I have the same problem but your post was unuseful…


(Spiritfaer) #8

Now I understand, people like me can mix up console.php and web.php files. Be smart and modify web.php


(Ganesh Patel) #9

Update in main.php config file.

image