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?
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', ..... ];
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.
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?
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', .....
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With