Skip to content

Instantly share code, notes, and snippets.

@speedygfw
Last active October 9, 2015 11:48
Show Gist options
  • Save speedygfw/3500595 to your computer and use it in GitHub Desktop.
Save speedygfw/3500595 to your computer and use it in GitHub Desktop.
example of ZfcUser ControllerPlugin
<?php
//module.php
public function getControllerPluginConfig()
{
return array(
'invokables' => array(
'zfcUserAuthentication' => 'ZfcUser\Controller\Plugin\ZfcUserAuthentication'
)
);
}
//controller
public function indexAction()
{
if ($this->zfcUserAuthentication()->hasIdentity()){
//do something
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment