I
I
Ivan Ivanov2019-06-18 15:58:14
PHP
Ivan Ivanov, 2019-06-18 15:58:14

Concatenate self::property?

Hello!
Is it possible and if so, how to properly concatenate self::property into curly braces of double quotes, otherwise it turns out to be an ugly snake.
Presently

$file_view = APP . '/views/' . self::$route['controller'] . '/' . self::$route['action'] . '.php';

Expected (but clear stump - syntax error)
$file_view = APP . "/views/{self::$route['controller']}/{self::$route['action']}.php";

I would like something, as in the expected variant.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman PHP, 2019-06-18
@Artsiom_Ryzhanki

will fail
.
is determined. Using single curly braces ({}) will not work to access the values ​​of functions, methods, class constants, or static class variables

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question