Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change standard Yii2 app name ("My Application")?

Tags:

yii2

I've tried to search the information according to this, but couldn't find any useful ones.. I just created email sending in Yii2 and the email sends as a "My Application", I guess it's because standard Yii::$app->name is like that. Could someone tell me how to change it?

like image 636
MKD Avatar asked May 20 '17 15:05

MKD


People also ask

How to change the application name in yii2?

Yii2 Default application name is “My Application”. You can change this name by editing the config/main.php. Just add the application name property in Config Array. NOTE: If you’re using the advanced app you will need to change the frontend and backbend config/main.php files. $config = [ 'id' => 'basic', 'name'=>'Snippet Guru', ..... ];

Where do I put my yii2 codebase?

We're using the Yii2 basic application template for our demonstration application. This places our codebase below the /hello root directory. Yii's configuration files in /hello/config/* are loaded whenever page requests are made. We'll use Yii's I18n message scripts to build out a configuration file for I18n in the common/config path.

What is the app parameter in Yii T?

Yii:t () is a function call that checks what language is currently selected and displays the appropriate translated string. The 'app' parameter refers to a section of our application. Translations can be optionally organized according to various categories. But where do these translated strings appear?

How do I change the name of the application?

You can change this name by editing the config/main.php. Just add the application name property in Config Array. NOTE: If you’re using the advanced app you will need to change the frontend and backbend config/main.php files. $config = [ 'id' => 'basic', 'name'=>'Snippet Guru', .....


1 Answers

Yii::$app->name value is assigned in your application config

You can change the id and name attribute in your config file

'id' => 'your-applicatio-id',
'name' => 'Your application Name',

these attributesa are store in different file depend by the template you are using

in basic templae you can set these values in

yourapp/confi/web.php

 $params = require(__DIR__ . '/params.php');

 $config = [
    'id' => 'your-id',
    'name' => 'Your Name',
     ......

in advanced template you can set these values in

 backend/config/main.php  

and in

 frontend/config/main.php

You can use it in common config file too common/config/main.php

like image 169
ScaisEdge Avatar answered Oct 20 '22 02:10

ScaisEdge