示例#1
0
文件: UrlToCity.php 项目: arbi/MyCode
 public function getProvinceName($cityId)
 {
     $provinceNameHelper = new ProvinceName();
     $provinceNameHelper->setServiceLocator($this->serviceLocator);
     $provinceDao = new \DDD\Dao\Location\Province($this->serviceLocator);
     $provinceId = $provinceDao->getProvinceIdByCityId($cityId);
     $provinceName = $provinceNameHelper->getFromCache($provinceId);
     if (!$provinceName) {
         return FALSE;
     }
     return strtolower(str_replace(' ', '-', $provinceName));
 }
示例#2
0
文件: Module.php 项目: arbi/MyCode
 public function getViewHelperConfig()
 {
     return array('factories' => array('textline' => function ($helperPluginManager) {
         $serviceLocator = $helperPluginManager->getServiceLocator();
         $helper = new View\Helper\Textline();
         $helper->setServiceLocator($serviceLocator);
         return $helper;
     }, 'productTextline' => function ($helperPluginManager) {
         $serviceLocator = $helperPluginManager->getServiceLocator();
         $helper = new View\Helper\ProductTextline();
         $helper->setServiceLocator($serviceLocator);
         return $helper;
     }, 'cityName' => function ($helperPluginManager) {
         $serviceLocator = $helperPluginManager->getServiceLocator();
         $helper = new View\Helper\CityName();
         $helper->setServiceLocator($serviceLocator);
         return $helper;
     }, 'phoneNumber' => function ($helperPluginManager) {
         $serviceLocator = $helperPluginManager->getServiceLocator();
         $helper = new View\Helper\PhoneNumber();
         $helper->setServiceLocator($serviceLocator);
         return $helper;
     }, 'provinceName' => function ($helperPluginManager) {
         $serviceLocator = $helperPluginManager->getServiceLocator();
         $helper = new View\Helper\ProvinceName();
         $helper->setServiceLocator($serviceLocator);
         return $helper;
     }, 'countryName' => function ($helperPluginManager) {
         $serviceLocator = $helperPluginManager->getServiceLocator();
         $helper = new View\Helper\CountryName();
         $helper->setServiceLocator($serviceLocator);
         return $helper;
     }, 'currencyList' => function ($helperPluginManager) {
         $serviceLocator = $helperPluginManager->getServiceLocator();
         $helper = new View\Helper\CurrencyList();
         $helper->setServiceLocator($serviceLocator);
         return $helper;
     }, 'currencyUser' => function ($helperPluginManager) {
         $helper = new View\Helper\CurrencyUser();
         return $helper;
     }, 'urltoCity' => function ($helperPluginManager) {
         $serviceLocator = $helperPluginManager->getServiceLocator();
         $helper = new View\Helper\UrlToCity();
         $helper->setServiceLocator($serviceLocator);
         return $helper;
     }, 'customBreadcrumb' => function ($helperPluginManager) {
         $serviceLocator = $helperPluginManager->getServiceLocator();
         $helper = new View\Helper\CustomBreadcrumb();
         $helper->setServiceLocator($serviceLocator);
         return $helper;
     }, 'userTracking' => function ($sm) {
         $viewHelper = new View\Helper\UserTracking();
         $viewHelper->setServiceLocator($sm->getServiceLocator());
         return $viewHelper;
     }, 'googleTagManager' => function ($sm) {
         $googleTagManagerHelper = new GoogleTagManager\GoogleTagManager();
         $googleTagManagerHelper->setServiceLocator($sm->getServiceLocator());
         return $googleTagManagerHelper;
     }));
 }