/**
  * {@inheritDoc}
  */
 public function createService(ServiceLocatorInterface $helpers)
 {
     $locator = $helpers->getServiceLocator();
     $viewHelper = new ZfcUserLoginWidget();
     $viewHelper->setViewTemplate($locator->get('zfcuser_module_options')->getUserLoginWidgetViewTemplate());
     $viewHelper->setLoginForm($locator->get('zfcuser_login_form'));
     return $viewHelper;
 }
 /**
  * {@inheritDoc}
  */
 public function createService(ServiceLocatorInterface $pluginManager)
 {
     /* @var $pluginManager HelperPluginManager */
     $serviceManager = $pluginManager->getServiceLocator();
     /* @var $options Options\ModuleOptions */
     $options = $serviceManager->get('zfcuser_module_options');
     $viewTemplate = $options->getUserLoginWidgetViewTemplate();
     /* @var $loginForm Form\Login */
     $loginForm = $serviceManager->get('zfcuser_login_form');
     $viewHelper = new ZfcUserLoginWidget();
     $viewHelper->setViewTemplate($viewTemplate)->setLoginForm($loginForm);
     return $viewHelper;
 }
Example #3
0
 public function getViewHelperConfig()
 {
     return array('factories' => array('zfcUserDisplayName' => function ($sm) {
         $locator = $sm->getServiceLocator();
         $viewHelper = new View\Helper\ZfcUserDisplayName();
         $viewHelper->setAuthService($locator->get('zfcuser_auth_service'));
         return $viewHelper;
     }, 'zfcUserIdentity' => function ($sm) {
         $locator = $sm->getServiceLocator();
         $viewHelper = new View\Helper\ZfcUserIdentity();
         $viewHelper->setAuthService($locator->get('zfcuser_auth_service'));
         return $viewHelper;
     }, 'zfcUserLoginWidget' => function ($sm) {
         $locator = $sm->getServiceLocator();
         $viewHelper = new View\Helper\ZfcUserLoginWidget();
         $viewHelper->setLoginForm($locator->get('zfcuser_login_form'));
         return $viewHelper;
     }));
 }