Created
February 22, 2012 09:02
-
-
Save NoxArt/1883493 to your computer and use it in GitHub Desktop.
Nette - expose more parameters to config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tacnayn\Config; | |
use Nette; | |
class Configurator extends Nette\Config\Configurator { | |
protected function getDefaultParameters() | |
{ | |
$parameters = parent::getDefaultParameters(); | |
$baseUrl = rtrim($this->container->httpRequest->getUrl()->getBaseUrl(), '/'); | |
$parameters['baseUrl'] = $baseUrl; | |
$parameters['basePath'] = preg_replace('#https?://[^/]+#A', '', $baseUrl); | |
return $parameters; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment