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