mirror of
https://github.com/getformwork/formwork.git
synced 2025-02-24 09:42:43 +01:00
Add correct Page::$slug
This commit is contained in:
parent
e683a89291
commit
64c7105b82
@ -54,6 +54,13 @@ class Page extends AbstractPage
|
|||||||
*/
|
*/
|
||||||
protected $id;
|
protected $id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Page slug
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $slug;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page filename
|
* Page filename
|
||||||
*
|
*
|
||||||
@ -125,6 +132,7 @@ class Page extends AbstractPage
|
|||||||
$this->route = Uri::normalize(preg_replace('~/(\d+-)~', '/', $this->relativePath));
|
$this->route = Uri::normalize(preg_replace('~/(\d+-)~', '/', $this->relativePath));
|
||||||
$this->uri = HTTPRequest::root() . ltrim($this->route, '/');
|
$this->uri = HTTPRequest::root() . ltrim($this->route, '/');
|
||||||
$this->id = FileSystem::basename($this->path);
|
$this->id = FileSystem::basename($this->path);
|
||||||
|
$this->slug = FileSystem::basename($this->route);
|
||||||
$this->loadFiles();
|
$this->loadFiles();
|
||||||
if (!$this->isEmpty()) {
|
if (!$this->isEmpty()) {
|
||||||
$this->parse();
|
$this->parse();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user