1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-11 09:14:58 +02:00

Add support for custom LanguagePage classes per feature request in processwire/processwire-issues#1246

This commit is contained in:
Ryan Cramer
2020-09-14 09:48:21 -04:00
parent 6cc5da1e45
commit 956ad5e201
4 changed files with 17 additions and 10 deletions

View File

@@ -606,7 +606,7 @@ class PageTraversal {
*/
public function urlOptions(Page $page, $options = array()) {
$config = $page->wire('config');
$config = $page->wire()->config;
$template = $page->template;
$defaults = array(
@@ -615,7 +615,7 @@ class PageTraversal {
'data' => array(),
'urlSegmentStr' => is_string($options) ? $options : '',
'urlSegments' => array(),
'language' => is_object($options) && $options instanceof Page && $options->className() === 'Language' ? $options : null,
'language' => is_object($options) && wireInstanceOf($options, 'Language') ? $options : null,
);
if(empty($options)) {
@@ -625,7 +625,7 @@ class PageTraversal {
}
$options = is_array($options) ? array_merge($defaults, $options) : $defaults;
$sanitizer = $page->wire('sanitizer');
$sanitizer = $page->wire()->sanitizer;
$language = null;
$url = null;