/** * Returns the attribute labels. * * @param \CModel $model * * @return array */ public static function getAttributeLabels(\CModel $model) { $labels = array(); foreach ($model->getAttributeConfigs() as $name => $config) { if (isset($config['label'])) { $labels[$name] = Craft::t($config['label']); } } return $labels; }