M
M
m1zysh0w2017-07-16 14:10:56
Yii
m1zysh0w, 2017-07-16 14:10:56

How to change the module icon to your own?

Good day. I asked myself one question about my module, how to change the icon of the module to my own ?! Help me please. Do not write about admin.css, because after each system update, the file is overwritten!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim Timofeev, 2019-01-24
@djienbaev97

$myModel = Mymodel::find()->where(['id'=>$someId])->one();
$data = yii\helpers\Json:decode($myModel->data);
echo $data['last_name'];

For convenience, you can make getters in the model
public function getLastName(){
    $data = yii\helpers\Json:decode($this->data);
    echo isset($data['last_name']) ? $data['last_name'] : 'не заданно';
}

and correspondingly
$myModel = Mymodel::find()->where(['id'=>$someId])->one();
echo $myModel->lastName;

A
Alexander Izmailov, 2019-01-24
@pocifis

Your data is in JSON format. You can use json_decode to work with this data further.

A
Alexey, 2019-01-24
@amexlar

Judging by the screenshot, you have regular JSON in data. In Yii2, starting from version 2.0.14, there are tools for working with JSON database fields.
You can also try this behavior

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question