2

I'm just wondering if there is a quick way to get a user's signature using something like the session class? For example to grab the active user's email from the session class you can simply call $this->EE->session->userdata('email');

I am referring to the native signature value also, and not a custom member field.

I would prefer to avoid running a secondary database query to get the information as time is definitely an issue in our case.

Cheers, Conor

1 Answer 1

5

Try this to see if it works for you. I just tested, and it works just fine for me.

$this->EE->session->userdata('signature')

To see all the values in the session values stored as userdata, just do the following:

var_dump($this->EE->session->userdata);
exit();
3
  • Excellent thanks, seems like the docs on the userdata object aren't as conclusive as they perhaps should be in that case. The above should have easy given a trial and error approach obviously but it would be great, especially for developers who are new to the platform to have a full view of Expression Engine's capabilities. Thanks again! Jan 24, 2013 at 9:15
  • 1
    Haha, yeah the dev docs aren't the best. Do yourself a favor and just start reading the code (it usually saves me a lot of time). I wouldn't have gotten anywhere if I relied on the docs! Jan 24, 2013 at 17:36
  • That's generally what I do also, but I thought the docs for the userdata object appeared to be quite elaborate. Let that be a lesson to everyone I suppose! print_r and var_dump are your friend for all things EE related. Jan 24, 2013 at 22:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.