slim-3

    0熱度

    1回答

    我使用Slim Framework 3與PHP-DI/Slim-Bridge。這是我的容器: $builder->addDefinitions([ 'settings.displayErrorDetails' => true, 'router' => get(Router::class), Twig::class => function(Contain

    2熱度

    1回答

    所以這是我第一次嘗試安裝和使用作曲家和其他包。 我在我的localhost上安裝了composer和slim 3,它工作得很好。 然後我繼續在遠程服務器上使用SSH進行安裝。 沒有錯誤發生,並且所有文件都在那裏。而在我的composer.json文件中,slim也是。我有一個自動加載文件。 但是,當我嘗試開始編寫一些代碼,這就像他們甚至沒有安裝,我得到這樣的錯誤作爲例子。 Parse error:

    0熱度

    1回答

    我試圖從justinrainbow實現JSON-架構驗證的中間件修身3. 我無法弄清楚如何獲得從GET/POST請求輸入客戶端中間件。 試過這樣: $mw = function ($request, $response, $next) { $data = $request->getParsedBody(); print_r($data); // prints nothing

    0熱度

    1回答

    在斯利姆3,這裏是在應用程序中注入的自定義錯誤處理程序示例: $container = new \Slim\Container(); $container['customError'] = function($c){ return function ($request, $response) use ($c) { $output = ['success'=>0, 'erro

    2熱度

    1回答

    我有一個帖子函數,用於在數據庫中插入關於該進程的信息並將電子郵件發送給一個收件人。 $app->post('/sendemail', function ($request, $response) { //Save info process $message = saveDataBaseInfo(); if ($message == "OK") {

    0熱度

    1回答

    在我的代碼中,當函數拋出一個錯誤,如組織名稱是必需的或它已被讀取存在時,catch塊可正常工作。但在成功的情況下,儘管插入了相應的組織,但我得到了錯誤消息200的狀態。我的代碼中有什麼錯誤。 insertTenancy是寫在Mycontroller中的函數。 public function insertTenancy($data,$user, $res) { $org_name =

    6熱度

    3回答

    我想檢查用戶是否登錄。因此,我有一個Class類,返回true或false。現在我想一箇中間件,如果用戶登錄,檢查。 $app->get('/login', '\Controller\AccountController:loginGet')->add(Auth::class)->setName('login'); $app->post('/login', '\Controller\Account

    0熱度

    2回答

    Im使用Slim Framework以JSON格式返回結果。 $app->get('/forecast_range/{latitude}/{longitude}/{timeStart}/{timeEnd}', function (Request $request, Response $response) { $latitude = $request->getAttribute('lat

    0熱度

    3回答

    你好。請給我新的php slim框架。我一整天都試圖通過作曲家下載並安裝slim 3,但一直沒有成功。 我正在使用windows pc。我使用命令提示符下載了作曲家並將作曲家安裝到了所需的目錄。然而,當我嘗試安裝苗條3,我得到一個錯誤:「安裝失敗,恢復./composer.json到原來的內容」 [命令提示符錯誤消息] [命令提示錯誤信息]

    10熱度

    1回答

    我們已經知道如何在斯利姆3添加自定義404 notFoundHandler: $container['notFoundHandler'] = function ($c) { return function ($request, $response) use ($c) { return $c->view->render($response, 'pages/404.html.tw