diff --git a/src/Aviat/AnimeClient/Config.php b/src/Aviat/AnimeClient/Config.php index d97c7450..ac58a675 100644 --- a/src/Aviat/AnimeClient/Config.php +++ b/src/Aviat/AnimeClient/Config.php @@ -7,9 +7,6 @@ namespace Aviat\AnimeClient; /** * Wrapper for configuration values - * - * @property Database Config $database - * @property Menu Config $menus */ class Config { diff --git a/src/Aviat/AnimeClient/Controller.php b/src/Aviat/AnimeClient/Controller.php index 95fd6972..80e836cf 100644 --- a/src/Aviat/AnimeClient/Controller.php +++ b/src/Aviat/AnimeClient/Controller.php @@ -98,10 +98,10 @@ class Controller { * * @param HtmlView $view * @param string $template - * @param array|object $data + * @param array $data * @return string */ - public function load_partial($view, $template, $data = []) + public function load_partial($view, $template, array $data = []) { $errorHandler = $this->container->get('error-handler'); $errorHandler->addDataTable('Template Data', $data); @@ -123,7 +123,7 @@ class Controller { throw new \InvalidArgumentException("Invalid template : {$template}"); } - return $view->render_template($template_path, $data); + return $view->render_template($template_path, (array)$data); } /** @@ -182,21 +182,6 @@ class Controller { $http->redirect($url, $code); } - /** - * Add a message box to the page - * - * @param string $type - * @param string $message - * @return string - */ - public function show_message($type, $message) - { - return $this->load_partial('message', [ - 'stat_class' => $type, - 'message' => $message - ]); - } - /** * Clear the api session * @@ -217,7 +202,7 @@ class Controller { { $message = ""; - if ($status != "") + /*if ($status != "") { $message = $this->show_message('error', $status); } @@ -225,7 +210,7 @@ class Controller { $this->outputHTML('login', [ 'title' => 'Api login', 'message' => $message - ]); + ]);*/ } /** diff --git a/src/Aviat/AnimeClient/MenuGenerator.php b/src/Aviat/AnimeClient/MenuGenerator.php index a062afec..af925d53 100644 --- a/src/Aviat/AnimeClient/MenuGenerator.php +++ b/src/Aviat/AnimeClient/MenuGenerator.php @@ -35,7 +35,7 @@ class MenuGenerator extends RoutingBase { public function __construct(ContainerInterface $container) { parent::__construct($container); - $this->menus = $this->config->menus; + $this->menus = $this->config->get('menus'); $this->helper = $container->get('html-helper'); } diff --git a/src/Aviat/AnimeClient/Router.php b/src/Aviat/AnimeClient/Router.php index 29bf29f1..9fccf31b 100644 --- a/src/Aviat/AnimeClient/Router.php +++ b/src/Aviat/AnimeClient/Router.php @@ -50,7 +50,7 @@ class Router extends RoutingBase { /** * Generate routes based on controller methods * - * @return [type] [description] + * @return void */ protected function generate_convention_routes() { @@ -106,7 +106,7 @@ class Router extends RoutingBase { * Handle the current route * * @codeCoverageIgnore - * @param [object] $route + * @param object $route * @return void */ public function dispatch($route = NULL) diff --git a/src/Aviat/AnimeClient/UrlGenerator.php b/src/Aviat/AnimeClient/UrlGenerator.php index 4b4c4b4d..972c1147 100644 --- a/src/Aviat/AnimeClient/UrlGenerator.php +++ b/src/Aviat/AnimeClient/UrlGenerator.php @@ -94,7 +94,6 @@ class UrlGenerator extends RoutingBase { $config_default_route = $this->__get("default_{$type}_path"); // Remove beginning/trailing slashes - $config_path = trim($config_path, '/'); $path = trim($path, '/'); // Remove any optional parameters from the route @@ -110,13 +109,7 @@ class UrlGenerator extends RoutingBase { if ($this->__get('default_to_list_view')) $path .= '/list'; } - // Set an leading folder - /*if ($config_path !== '') - { - $path = "{$config_path}/{$path}"; - }*/ - return "//{$host}/{$path}"; } } -// End of UrlGenerator.php +// End of UrlGenerator.php \ No newline at end of file