mirror of
https://github.com/getgrav/grav.git
synced 2026-03-06 12:31:53 +01:00
Added RouteFactory::createFromString() rename MarkdownFormatter configuration option
This commit is contained in:
@@ -22,10 +22,10 @@ class MarkdownFormatter implements FormatterInterface
|
||||
'header' => 'header',
|
||||
'body' => 'markdown',
|
||||
'raw' => 'frontmatter',
|
||||
'formatter' => ['inline' => 20]
|
||||
'yaml' => ['inline' => 20]
|
||||
];
|
||||
|
||||
$this->headerFormatter = $headerFormatter ?: new YamlFormatter($this->config['formatter']);
|
||||
$this->headerFormatter = $headerFormatter ?: new YamlFormatter($this->config['yaml']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,6 +28,23 @@ class RouteFactory
|
||||
return new Route($parts);
|
||||
}
|
||||
|
||||
public static function createFromString($path)
|
||||
{
|
||||
$path = ltrim($path, '/');
|
||||
$parts = [
|
||||
'path' => $path,
|
||||
'query' => '',
|
||||
'query_params' => [],
|
||||
'grav' => [
|
||||
'root' => self::$root,
|
||||
'language' => self::$language,
|
||||
'route' => $path,
|
||||
'params' => ''
|
||||
],
|
||||
];
|
||||
return new Route($parts);
|
||||
}
|
||||
|
||||
public static function getRoot()
|
||||
{
|
||||
return self::$root;
|
||||
|
||||
Reference in New Issue
Block a user