How to get the Attribute Label of a attribute in a Model using Yii Framework

H

How Can We Help?

How to get the Attribute Label of a attribute in a Model using Yii Framework

  1. Use the getAttributeLabel() method (available since v1.1.4)
  2. Code Example:
    Products::model()->getAttributeLabel('brand_id')
  3. The above example gets the attribute label for the brand_id attribute in the model Products.

About the author

Ian Carnaghan

I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.

About Author

Ian Carnaghan

I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.

Follow Me