hello,
So I have my model ($user) which I’m trying to update through a form. And for some reason, when I set $user -> attributes = $_POST[‘User’]; the model’s attributes don’t change …
Maybe my logic is broken somewhere!?
$user_id = $_GET[ 'id' ];
$user = User::model() -> findByPk( $user_id );
if( isset( $_POST[ 'User' ] ) )
{
var_dump( $_POST[ 'User' ] );
$user -> attributes = $_POST[ 'User' ];
echo '<br />';
// so I expect this to be the same as $_POST['User'], but it's not :/
var_dump( $user -> attributes );
// this will always PASS (ie. required username!?)
if( $user -> validate() )
{
;
}
// this is ALWAYS empty
var_dump( $user->getErrors() );
exit();
}
“I feel like I’m taking crazy-pills”
thanks,
–iM