slim-3

    0熱度

    1回答

    我在將一些自定義中間件添加到使用tuupola/cors和slim-jwt-auth並將頭中存儲的jwt令牌用作身份驗證的slim 3項目時遇到問題。 一切正常。當從chrome發出ajax請求時,它首先發送一個選項請求以確認可以進行訪問,然後發送正確的請求並在標題中將jwt令牌作爲Authorization:Bearer發送,但是當我向流中添加額外的中間件時,發送選項請求並返回200 Ok,但實

    1熱度

    1回答

    當標題讀取時,我無法讓我的會話變量在路由上保持不變。 我在我的index.php的非常開始處撥打session_start()。 根路線: $app->get('/', function (Request $request, Response $response) { $this->logger->addInfo("session id: " . $_SESSION['cus_id'])

    0熱度

    1回答

    我必須驗證文件的一些屬性,將它們轉換爲PNG,並將它們移動到亞馬遜S3服務,但我需要將文件移動到存儲桶,只有當控制器驗證成功,客戶要求是使用中間件來實現這一目標。有沒有辦法做到這一點是必要的,即使使用$請求 - > withAttribute()?

    1熱度

    2回答

    我正在使用Slim Framework版本3並且存在一些問題。 $app-> post('/', function($request, $response){ $parsedBody = $request->getParsedBody()['email']; var_dump($parsedBody); }); 結果總是: 空 你能幫助我嗎?

    1熱度

    1回答

    加載使用超薄框架苗條中間件自定義類是我的榜樣路線,我有一個自定義類名爲範疇,但我得到的錯誤是這樣Class 'app\Category' not found $app->get('/category',function($request, $response, $args){ $categories = new app\Category(); $categories->ge

    -1熱度

    1回答

    我是Slim Framework 3中的新成員。訪問具有Api Key標頭值的Web服務時遇到問題。我有一個Api Key值,並想訪問Web服務來獲取JSON數據。這裏是我的苗條get方法代碼: $app->get('/getbooking/{id}', function (Request $request, Response $response, $args) { $id = $arg

    1熱度

    1回答

    我使用超薄3,它採用nikic/FastRoute,和我與像這樣的端點麻煩: $app->get('/count/{url}', function ($request, $response) use ($curl) { $controller = new Proximate\Controller\CountUrl($request, $response); $controlle

    1熱度

    1回答

    這裏我對slim3樣品FastRoute: $app->get('/api/search/[{domaine}[/{notused:.+}]]', function ($request, $response, $args) { return $this->renderer->render($response, 'index.phtml', $args); }); 這個FastRou

    0熱度

    1回答

    我必須做錯了什麼。 我想要一個路線,分析並放在一起GET參數數組重定向到另一個預計參數GET的路線。 我希望這會工作,在那裏我通過$search_params作爲pathFor()方法的一部分: // SEARCH VIEW $app->get('/search', function ($request, $response, $args) { $api = $this->APIReq

    0熱度

    1回答

    我想將中間件添加到我的Slim項目中,該項目在允許訪問用戶之前檢查用戶的IP。 我中間件類: <?php namespace App\Middleware; Class IpFilter { protected $request_ip; protected $allowed_ip; public function __construct($allowedip = array