Skip to content

Commit

Permalink
Merge pull request #5 from tdt/development
Browse files Browse the repository at this point in the history
Version 0.0.2
  • Loading branch information
dive-michiel committed Aug 7, 2013
2 parents 5f57b60 + 8c5bcf6 commit d204b52
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tdt/pages/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function __construct($config = array()){
if(class_exists('\app\core\Config')){
// Get root folder for building relative URLS for assets
$this->baseURL = '/'. \app\core\Config::get('general', 'subdir') . PACKAGE_PATH;
$this->baseURL = str_replace('//', '/', $this->baseURL);
}else{
// Assume the example file is served
$this->baseURL = '../public/';
Expand Down Expand Up @@ -143,6 +144,7 @@ public function generate($body, $template = 'base'){
if($template == 'resource'){
$url = $this->getCurrentURI();
$url = preg_replace('/(\.about|\.html)$/', '', $url);
$url = str_replace('//', '/', $url);
$data['json_link'] = $url . '.json';
$data['xml_link'] = $url . '.xml';
}
Expand Down Expand Up @@ -183,6 +185,6 @@ public function error($code, $message, $body){


private function getCurrentURI() {
return preg_replace('/index\.php$/', '', $_SERVER["PHP_SELF"]) . $_SERVER["REQUEST_URI"];
return preg_replace('/index\.php$/', '', $_SERVER["PHP_SELF"]) . $_SERVER["REQUEST_URI"];
}
}

0 comments on commit d204b52

Please sign in to comment.