Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
accessing profile field in SimpleAUth

  • I Use simpleauth but still don't understand how to retrieve nor use profile_fields. 
    I use oil console
    >>Auth::create_user('somebody','somebody','',100,array( 'dept'=>'accounting'));

    so in the table Users  the profile_fields store data like this 


    I don't understand how to get "accounting" and displaying it in view.

    thank you for the advise..  :)

  • echo Auth::get('accounting', 'not set') would do fine?
  • so I do this.,
    controller action_index(){
    $this->template->title = 'Dashboard';
    $this->template->content = View::forge('admin/dashboard');

    in view admin/dashboard echo Auth::get('accounting', 'not set');
     the result is echoing "not set"...,

    i try to change view to echo Auth::get('dept', 'not sure');  the result is echoing "not sure"...,

    :) I don't understand how to get data "accounting" or dept=>accounting

  • Is a user logged in? Auth methods operate on the current user only.
  • Sorry.., my mistake I miss the Auth::get_profile_fields(); function :) it's easier now., thank @Harro

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion