silkfire
silkfire

Reputation: 25955

Get static variable from object property (string)

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'.

Upvotes: 1

Views: 177

Answers (1)

Ali Akbar Azizi
Ali Akbar Azizi

Reputation: 3506

maybe its help you

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

Upvotes: 1

Related Questions