I am trying to get the class attributes for each model class in my application. My model classes extends yii\db\ActiveRecord and have been created via gii. So What I am trying to get is the model attributes same when you use $object->attributes() but with a class name instead of a class object that’s why I am using php reflection class -> get property. The problem is I am getting an empty array.
Question 1: How to get class attributes using class name (full with path/name space)?
Question 2: Is there a way to get the class attributes with class shortname only? Note: I am not repeating class names so there should not be any conflict from having similar class names on different paths.
Here is a copy of example code:
//Role is a model class in my application
//$array comes back empty…
The role class has the following attributes