Closed exploradatos closed 4 years ago
You can change the app name using: Yii::$app->name = Yii::$app->keyStorage->get('key_app_name');
. Preferably, this should be done before an action is executed, during the bootstrap process, or with the [beforeAction()
](https://www.yiiframework.com/doc/api/2.0/yii-base-controller#beforeAction()-detail) method override inside your controller(s).
But, I would suggest to not do this. You'd be better off doing the changes where you want to show this text. I'm guessing you want to show this as the page title or in the menu. For the menu text, you should go to frontend/view/layout/base.php
, and change the brandLabel
attribute of the Navbar with Yii::$app->keyStorage->get('key_app_name')
instead of Yii::$app->name
.
For the site/index
, you should change the $this->title
value the same way I did with the Navbar label.
You should do this change in every place you want to override the "app name".
Also, I want to suggest you change the base name to something more meaningful to you.
excellent, consider the second recommendation.
I'm trying to make name customized the base.php so that it can be changed, using the table
tbl_key_storage_item
, in backend use the functionYii::$app->keyStorage->get ()
, but incommon
I can't use that function, you can give me some idea how to get the name of the tabletbl_key_storage_item