Skip to content

Instantly share code, notes, and snippets.

@kallepersson
Created June 26, 2012 22:42
Show Gist options
  • Save kallepersson/2999827 to your computer and use it in GitHub Desktop.
Save kallepersson/2999827 to your computer and use it in GitHub Desktop.
//model
/**
* @return array customized attribute labels (name=>label)
*/
public function attributeLabels()
{
return array(
'id' => 'ID',
'user_name' => 'Användarnamn',
'password' => 'Lösenord',
'email' => 'E-postadress',
'first_name' => 'Förnamn',
'last_name' => 'Efternamn',
'status' => 'Status',
'group_id' => 'Användargrupp',
'last_login' => 'Senaste inloggning',
);
}
//view
$usersDataProvider = new CArrayDataProvider($model->users, array('id'=>'User'));
$this->widget('zii.widgets.grid.CGridView', array(
'dataProvider'=>$usersDataProvider,
'columns' => array(
array(
'header' => 'Användare',
'type' => 'raw',
'value' => '$data->link',
),
'last_login',
)
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment