1

How do I get a static variable dynamically?

I'm trying this but getting the dreaded PAAMAYIM error:

foreach($this->entity::$dialog_data as $property) {

Should result in Company::$dialog_data because $this->entity contains the string 'Company'.

1 Answer 1

1

maybe its help you

$temp = $this->entity;
foreach($temp::$dialog_data as $property) {
Sign up to request clarification or add additional context in comments.

3 Comments

I'd like to avoid any temp variables.
i think there is no another way
@sikfire i searching and read somewhere this is possible only with temp variable

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.