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