ZfcUser and Zend Framework 2 -
i love zfcuser , use every project develop. works great, looking expand usage of bit.
are there examples can offer checking identity in controller? have function fires when action given function accessed... add authentication function, said, runs in controller.
any advice (or documentation?) appreciated!
thanks
checking auth identity in controller pretty straightforward.
public function thataction() { $auth = $this->getservicelocator()->get('zfcuser_auth_service'); if( $auth->hasidentity() ) $user = $auth->getidentity(); }
pretty easy right! can find more, here: https://github.com/zf-commons/zfcuser/wiki/how-to-check-if-the-user-is-logged-in
the user object back, user entity. if want customize user entity, have small blog post here may help: http://circlical.com/blog/2013/4/1/l5wftnf3p7oks5561bohmb9vkpasp6
Comments
Post a Comment