From 96aec642b1bd5589bf0494d1200b5375bdfb692e Mon Sep 17 00:00:00 2001 From: "CORP\\phedor" Date: Tue, 27 Mar 2018 18:10:46 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B4=D0=BB=D1=8F=20composer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 4 ++-- src/Controller/Front.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index de9a023..4c325c2 100644 --- a/composer.json +++ b/composer.json @@ -8,8 +8,8 @@ } ], "autoload": { - "psr-0": { - "": "src/" + "psr-4": { + "ctiso\\": "src/" } } } diff --git a/src/Controller/Front.php b/src/Controller/Front.php index 7d805a8..9b5e718 100644 --- a/src/Controller/Front.php +++ b/src/Controller/Front.php @@ -111,11 +111,12 @@ class Front extends Action } else { $controller = null; } + try{ return $this->loadModule($name[0], $request, $controller); } catch (UserMessageException $ex) { //Исключение с понятным пользователю сообщением $mode = $request->get('mode'); - if($mode == 'ajax' || $mode == 'json'){ + if ($mode == 'ajax' || $mode == 'json') { return json_encode(['result'=>'fail', 'message'=> $ex->userMessage]); } else { return $ex->userMessage;