Exemplo n.º 1
0
 /**
  * Initializes this module.
  * This method is required by the IModule interface.
  * @param mixed configuration for this module, can be null
  * @throws TConfigurationException if module is configured in the global scope.
  */
 public function init($config)
 {
     parent::init($config);
     if ($this->getRequest()->getRequestResolved()) {
         throw new TConfigurationException('urlmapping_global_required');
     }
     if ($this->_configFile !== null) {
         $this->loadConfigFile();
     }
     $this->loadUrlMappings($config);
     if ($this->_urlPrefix === '') {
         $this->_urlPrefix = $this->getRequest()->getApplicationUrl();
     }
     $this->_urlPrefix = rtrim($this->_urlPrefix, '/');
 }
Exemplo n.º 2
0
 /**
  * Initializes this module.
  * This method is required by the IModule interface.
  * @param mixed configuration for this module, can be null
  * @throws TConfigurationException if module is configured in the global scope.
  */
 public function init($config)
 {
     parent::init($config);
     if ($this->getRequest()->getRequestResolved()) {
         throw new TConfigurationException('urlmapping_global_required');
     }
     if ($this->_configFile !== null) {
         $this->loadConfigFile();
     }
     $this->loadUrlMappings($config);
     if ($this->_urlPrefix === '') {
         $request = $this->getRequest();
         if ($request->getUrlFormat() === THttpRequestUrlFormat::HiddenPath) {
             $this->_urlPrefix = dirname($request->getApplicationUrl());
         } else {
             $this->_urlPrefix = $request->getApplicationUrl();
         }
     }
     $this->_urlPrefix = rtrim($this->_urlPrefix, '/');
 }