diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-10-16 12:47:11 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-10-16 12:47:11 +0200 |
commit | 7f5250421be4832b9679d8140bc4a71c8005dfa3 (patch) | |
tree | a47e846cef666dbd1c2c7d05a01fd32aa8311d4f /application/render/PageBuilder.php | |
parent | ec457491879893c8cfcc9dd6542d1593aa5c91f5 (diff) | |
download | Shaarli-7f5250421be4832b9679d8140bc4a71c8005dfa3.tar.gz Shaarli-7f5250421be4832b9679d8140bc4a71c8005dfa3.tar.zst Shaarli-7f5250421be4832b9679d8140bc4a71c8005dfa3.zip |
Support using Shaarli without URL rewriting
- Shaarli can be fully used by prefixing any URL with /index.php/
- {$base_path} used in templates already works with this configuration
- Assets path (outside of theme's assets) must be prefixed with {$root_url}/
- Documentation section in « Server configuration »
Fixes #1590
Diffstat (limited to 'application/render/PageBuilder.php')
-rw-r--r-- | application/render/PageBuilder.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/application/render/PageBuilder.php b/application/render/PageBuilder.php index 41b357dd..2d6d2dbe 100644 --- a/application/render/PageBuilder.php +++ b/application/render/PageBuilder.php | |||
@@ -174,10 +174,12 @@ class PageBuilder | |||
174 | } | 174 | } |
175 | } | 175 | } |
176 | 176 | ||
177 | $rootPath = preg_replace('#/index\.php$#', '', $basePath); | ||
177 | $this->assign('base_path', $basePath); | 178 | $this->assign('base_path', $basePath); |
179 | $this->assign('root_path', $rootPath); | ||
178 | $this->assign( | 180 | $this->assign( |
179 | 'asset_path', | 181 | 'asset_path', |
180 | $basePath . '/' . | 182 | $rootPath . '/' . |
181 | rtrim($this->conf->get('resource.raintpl_tpl', 'tpl'), '/') . '/' . | 183 | rtrim($this->conf->get('resource.raintpl_tpl', 'tpl'), '/') . '/' . |
182 | $this->conf->get('resource.theme', 'default') | 184 | $this->conf->get('resource.theme', 'default') |
183 | ); | 185 | ); |