We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

about model create whiteList

Excuse me,How to use the model in create to whiteList? thanks

    $user = new Users();
    $fields = array('username', 'age', 'created_at');
    $user->save(array('username'=>'john', 'age'=>18), $fields);
    echo $user->age;


1.7k

sorry, I am a Chinese

I'm thinking that you are going to need to ask your question again in better English and in a more detailed form.



2.2k

Don't worry. I can't get what you want to say, though.

If the code of @trentramseyer is what you wanted to know, would you please click Accept Answer button?



1.7k

very thanks, I failed, Because the current framework required to write the mysql fields by default

  $user = new Users();
   $fields = array('username', 'age', 'created_at');
   $user->save(array('username'=>'john', 'age'=>18), $fields);
   echo $user->age;


1.7k

sorry, I'm Chinese,But still thank you, I failed, Because the current framework required to write the mysql fields by default

Don't worry. I can't get what you want to say, though.

If the code of @trentramseyer is what you wanted to know, would you please click Accept Answer button?



2.2k

Because the current framework required to write the mysql fields by default

I can't get what you say.

What happened? Did you get error messages?

And what you exactly want to do? What do you mean by "whitelist"?