silex

    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熱度

    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熱度

    2回答

    我正在努力與Silex及其項目結構。我現在使用PHP已經有10年了,但我總是使用Np ++之類的工具。現在我開始使用PhpStorm,我覺得自己像個新手一樣。 我試圖,是創建Silex的項目。開始一個新的作曲家項目後,我得到以下結構: --doc --src ----Silex ------[Some Silex files] --tests --vendor [some rootfi

    0熱度

    1回答

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

    0熱度

    1回答

    我對簡單網站使用Silex。 我使用Doctrine DBAL和那個項目 https://github.com/dflydev/dflydev-doctrine-orm-service-provider 作爲ORM和實體管理器。 我知道如何從控制器訪問該管理器,但我想知道如何從Model類執行該操作。 例如,我們有 class UserModel { public function getPh

    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