当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Controller_Front::setBaseUrl方法代码示例

本文整理汇总了PHP中Zend_Controller_Front::setBaseUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Front::setBaseUrl方法的具体用法?PHP Zend_Controller_Front::setBaseUrl怎么用?PHP Zend_Controller_Front::setBaseUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Controller_Front的用法示例。


在下文中一共展示了Zend_Controller_Front::setBaseUrl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initRoutes

 public function initRoutes()
 {
     $config = Zend_Registry::get('config');
     $this->_front->setBaseUrl($config->system->web->baseurl);
     $nl = array('content' => 'inhoud', 'news' => 'nieuws', 'events' => 'kalender', 'doctor' => 'team');
     $fr = array('content' => 'contenu', 'news' => 'nouvelles', 'events' => 'kalender', 'doctor' => 'team');
     $translator = new Zend_Translate('array', $nl, 'nl');
     $translator->addTranslation($fr, 'fr');
     $request = $this->getRequest();
     $languageTranslator = substr($request->getRequestUri(), 1, 2);
     $locales = $config->locale->list->toArray();
     if (!isset($locales[$languageTranslator])) {
         $languageTranslator = $config->locale->default;
     }
     $translator->setLocale($languageTranslator);
     Zend_Controller_Router_Route::setDefaultTranslator($translator);
     $router = $this->_front->getRouter();
     $localeRoute = new Zend_Controller_Router_Route(':lng', array('controller' => 'index', 'action' => 'content', 'module' => 'default', 'lng' => 'nl'), array('lng' => '(nl|fr)'));
     $router->addRoute('locale', $localeRoute);
     $contentRoute = new Zend_Controller_Router_Route_Regex('(.+)', array('controller' => 'index', 'action' => 'content', 'url' => null), array(1 => 'url'), '%s');
     $router->addRoute('content', $localeRoute->chain($contentRoute, '/'));
     $router->addRoute('events-index', $localeRoute->chain(new Zend_Controller_Router_Route('@events/*', array('controller' => 'events', 'action' => 'index')), '/'));
     $router->addRoute('events-detail', $localeRoute->chain(new Zend_Controller_Router_Route('@events/:id/:title', array('controller' => 'events', 'action' => 'detail'), array('id' => '\\d+')), '/'));
     $router->addRoute('contact', $localeRoute->chain(new Zend_Controller_Router_Route('@contact/*', array('controller' => 'contact', 'action' => 'form')), '/'));
     $router->addRoute('sitemap', $localeRoute->chain(new Zend_Controller_Router_Route('@sitemap/*', array('controller' => 'sitemap', 'action' => 'index')), '/'));
     $router->addRoute('doctor-index', $localeRoute->chain(new Zend_Controller_Router_Route('@doctor/*', array('controller' => 'doctor', 'action' => 'index')), '/'));
     $router->addRoute('doctor-detail', $localeRoute->chain(new Zend_Controller_Router_Route('@doctor/:id/:title', array('controller' => 'doctor', 'action' => 'detail'), array('id' => '\\d+')), '/'));
     $router->addRoute('ajax-captcha', $localeRoute->chain(new Zend_Controller_Router_Route('captcha', array('controller' => 'index', 'action' => 'ajaxcaptcha')), '/'));
     /* NEWS EXAMPLE */
     $router->addRoute('news-index', $localeRoute->chain(new Zend_Controller_Router_Route('@news/*', array('controller' => 'news', 'action' => 'index')), '/'));
     $router->addRoute('news-detail', $localeRoute->chain(new Zend_Controller_Router_Route('@news/:id/:title', array('controller' => 'news', 'action' => 'detail'), array('id' => '\\d+')), '/'));
     /* NEWS EXAMPLE END */
     $router->addRoute('admin', new Zend_Controller_Router_Route('admin/:controller/:action/*', array('controller' => 'index', 'action' => 'index', 'module' => 'admin')));
     $router->addRoute('file-download', new Zend_Controller_Router_Route_Regex('files/(.*)', array('controller' => 'file', 'action' => 'download'), array(1 => 'filename'), 'files%s'));
 }
开发者ID:sonvq,项目名称:2015_freelance6,代码行数:35,代码来源:Bootstrap.php

示例2: setBaseURL

 /**
  * Overload the setBaseURL method.
  */
 public function setBaseURL($base = null)
 {
     // First get the config object
     $registry = Zmax_Bootstrap::getRegistry();
     $zmax_context = $registry->get("zmax_context");
     $config = $zmax_context->config;
     // Remove the trailing '/'
     parent::setBaseUrl($this->cleanUrl($config->app->base_url));
 }
开发者ID:camilorivera,项目名称:INNOVARE,代码行数:12,代码来源:Front.php

示例3: initModules

 /**
  * Add modules
  */
 public function initModules()
 {
     $this->frontController->addModuleDirectory($this->corePath . '/application/modules');
     foreach ($this->modules as $module) {
         $this->frontController->addControllerDirectory($this->corePath . '/application/modules/' . $module . '/controllers', $module);
     }
     $this->frontController->setParam('useDefaultControllerAlways', true);
     $this->frontController->setBaseUrl($this->config->general->baseUrl);
     $this->registry->set('baseUrl', $this->config->general->baseUrl);
 }
开发者ID:Cryde,项目名称:sydney-core,代码行数:13,代码来源:Bootstrapper.php


注:本文中的Zend_Controller_Front::setBaseUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。