A
A
Alexander Ivanov2015-05-19 09:44:34
Yii
Alexander Ivanov, 2015-05-19 09:44:34

How to set title from two values ​​in YII2?

Tried several ways:

$Family=volonterFamily;
$Name=volonterName;
$NameFamily=(string)$Name+(string)$Family;
$this->title = $model->$NameFamily;
error //ответ на выдаче

$Family=volonterFamily;
$Name=volonterName;
$NameFamily=$Name+$Family;
$this->title = $model->$NameFamily;
error //ответ на выдаче

//volonterFamily;
//volonterName;
$this->title = $model->volonterFamily & volonterName;
P"@ @[email protected] A //ответ на выдаче

//volonterFamily;
//volonterName;
$this->title = $model->volonterFamily+volonterName;
0 //ответ на выдаче

//volonterFamily;
//volonterName;
$this->title = $model->volonterFamily and volonterName;
volonterFamily //ответ на выдаче

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xtalen, 2015-05-19
@cimonlebedev

String concatenation in php is ".", i.e.
$this->title = $model->volunteerFamily . " " . $model->volonterName"
Or like this:
$this->title = "$model->volonterFamily $model->volonterName"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question