From fa4ee22100b85e6f7a737a881c4db41bf68e5c49 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 30 Mar 2017 16:47:02 -0400 Subject: [PATCH] Allow over-riding the default lists in the user config --- app/config/route_config.toml.example | 19 +++++++++++++++++++ src/RoutingBase.php | 6 ++---- 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 app/config/route_config.toml.example diff --git a/app/config/route_config.toml.example b/app/config/route_config.toml.example new file mode 100644 index 00000000..74191a89 --- /dev/null +++ b/app/config/route_config.toml.example @@ -0,0 +1,19 @@ +################################################################################ +# Route config +# +# Default views and paths +################################################################################ + +# Path to public directory, where images/css/javascript are located, +# appended to the url +asset_path = "/public" + +# Which list should be the default? +default_list = "anime" # anime or manga + +# Default pages for anime/manga +default_anime_list_path = "watching" # watching|plan_to_watch|on_hold|dropped|completed|all +default_manga_list_path = "reading" # reading|plan_to_read|on_hold|dropped|completed|all + +# Default view type (cover_view/list_view) +default_view_type = "cover_view" \ No newline at end of file diff --git a/src/RoutingBase.php b/src/RoutingBase.php index b6269b48..eaf247ed 100644 --- a/src/RoutingBase.php +++ b/src/RoutingBase.php @@ -71,11 +71,9 @@ class RoutingBase { */ public function __get($key) { - $routingConfig =& $this->routeConfig; - - if (array_key_exists($key, $routingConfig)) + if (array_key_exists($key, $this->routeConfig)) { - return $routingConfig[$key]; + return $this->routeConfig[$key]; } }