silex

    0熱度

    2回答

    我正在使用PHP,Silex和PostgreSQL數據庫。我有一段代碼執行完全按照預期: $statement = $app['pdo']->query("SELECT * FROM my_table LIMIT 50"); $string = $statement->fetchAll(PDO::FETCH_ASSOC); $json = json_encode($string); retu

    -1熱度

    1回答

    我想弄清楚如何讓Silex中的錯誤處理程序呈現一個樹枝模板。這是他們在文檔中提供: $app->error(function (\Exception $e, Request $request, $code) { return new Response('We are sorry, but something went terribly wrong.'); }); 我寫的是: $ap

    0熱度

    2回答

    我想用PHP請求的用戶大小顯示圖像。 工作代碼。沒有框架。 <?php require_once __DIR__ . '/vendor/autoload.php'; define('BASE_SIZE', 1000); $original = imagecreatefrompng('image.png'); $size = $_REQUEST['size']; if($size

    0熱度

    1回答

    我是Silex Framework的新成員,當訪問者試圖註冊一個新帳戶(關於其用戶名)不能保存他的請求時,我試圖進行驗證檢查數據庫。我看到我們在Symfony中有Unique Entity,但我無法導入Silex。我一直在尋找兩天的解決方案,但徒勞無益

    0熱度

    1回答

    我做了一箇中間件,在每次請求之前對用戶進行身份驗證,並在整個應用程序的開始時應用它。 $app->before(function($request, $app) { Auth::authenticate($request, $app); }); 但它也適用於登錄路由如何解決這一問題? 這是一個Rest API。

    0熱度

    1回答

    我嘗試按照Silex official website上的教程進行操作,但在Authenticator註冊爲服務時出現錯誤。 Catchable fatal error: Argument 1 passed to App\Security\TokenAuthenticator::__construct() must be an instance of App\Security\EncoderFac

    0熱度

    1回答

    使用作曲家更新後,我的表單上出現此問題。 [2017-06-26 10:35:26] MicroCMS.CRITICAL: Symfony\Component\Form\Exception\UnexpectedTypeException: Expected argument of type "string", "MicroCMS\Form\Type\NewsletterType" given (u

    1熱度

    1回答

    使用Silex 2,我堅持了幾個小時才找到一種方法來覆蓋DaoAuthenticationProvider類的checkAuthentication方法? 關於上下文:我使用自定義UserToken定義了身份驗證偵聽器和提供程序。 $app['security.authentication_listener.factory.sds'] = $app->protect(function ($name

    1熱度

    1回答

    是否有可能定義Silex路線的路線定義去。舉例來說,定義以下途徑取決於以前的路線是什麼: /a/{user}/{app_name}/list/ -> /a/{user}/{app_name}/list/{id}/ /a/{user}/{app_name}/add/ -> /a/{user}/{app_name}/add/success/ /a/{user}/{app_name}/help/ -

    0熱度

    1回答

    有沒有辦法用Symfony依賴注入交換Pimple? 我可以使用Symfony的依賴注入作爲一個獨立的包Silex的,但我需要換疙瘩它,因爲我不能訪問與Symfony的依賴注入從Silex的像註冊控制器: $app->get('/route', 'testController:indexAction');