I use CI tank_auth library to have user's registration form and need to add new fields that tank_auth didn't come with.
I did refer to this Tank Auth Adding Fields, but it never helps me to solve my doubt.
Let's say, I want to have additional 'Name' field during registration, I had created it in views and function register()
controller, that's works fine except when I want to put it in user_profiles
table, I created a column called name
, and then in tank_auth model's users.php, I find below method and added:
private function create_profile($user_id, $name)
{
$this->db->set('user_id', $user_id);
$this->db->set('name', $name);
return $this->db->insert($this->profile_table_name);
}
When I run registration, no error occurred, I check with the table, the name
field is not insert, so I guess it might be no parameter pass to $name
, here is my problem, where could I pass the parameter to this function?
I hope there is someone with experiences with this library can clear my doubt.
Thanks.
SOLUTION:
@Joan-Diego Rodriguez has a very good practice on how to add additional fields into tank_auth's user_profiles table during register process.
CodeIgniter: Passing fields to user_profiles database with Tank_auth
Hope this would help someone who looking for the same solution.