A
A
Alexey Yamberg2017-03-23 22:58:10
Yii
Alexey Yamberg, 2017-03-23 22:58:10

What is the essence of the design, how to understand it?

There is the following construction: I want to understand .. just to understand what it is and how it works.
$target->{$this->leftAttribute}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2017-03-23
@m_finger

do not read the man - just create a question on the toaster!
php.net/manual/en/language.types.string.php#langua...
php.net/manual/en/language.variables.variable.php
ideone.com/G0UZHD so clear?

I
Ivanq, 2017-03-23
@Ivanq

It is considered $this->leftAttribute. For example, this would be foo_bar. Replaced {$this->leftAttribute}with foo_bar. It turns $target->foobarout - an appeal to the property by name.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question