problem about silex-Collection of common programming errors


  • Hines Bourne
    symfony2 silex
    I have an AngularJS front end being served via domain.com/index.html. My API calls are all in the same domain scope at domain.com/api/*. I want to enable standard username/password authentication. However, all I need the Silex back end to do is set the session up and return a 200 success or 401 failure status codes at login time. I found pieces of code from the silex, symfony2 docs as SO but just can’t get it quite right. I basically setup my custom Success/Failure custom handlers to return the

  • ziiweb
    php silex
    I’m trying to add a third party provider to silex: assetic. I’m trying this way:<?php require_once __DIR__.’/../vendor/autoload.php’;$app = new Silex\Application(); $app[‘autoloader’]->registerNamespace(‘SilexExtension’, DIR_VENDOR.’/kriswallsmith/assetic/src’); $app[‘debug’] = true;$app->register(new Silex\Provider\TwigServiceProvider(), array(‘twig.path’ => __DIR__.’/views’),new SilexExtension\AsseticExtension(), array(‘assetic.class_path’ => ‘/home/tirengarfio/workspace/canalon

  • benoit
    php symfony2 silex
    I built a Silex project with an login mechanism.Not being a Symfony expert, I strictly followed the guidelines here for the authentication process : http://silex.sensiolabs.org/doc/providers/security.html… and it works fine on my development environmentHowever, when I pushed my project on my production server, I get the following error each time I try to log into my web app[2012-12-18 16:35:33] CRITICAL: Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException: A To

  • user1772403
    url twig fatal-error helpers silex
    I’m struggling with a problem while trying to render an custom error page in Silex.According to what I found in here: http://refactoring.us/silex/custom-error-pages-with-silex-and-twig/ I’m trying to set a custom 404 page in my application. Everything works fine until I start to use helpers in my twig template.An exemplary code for 404 error page template:{% extends “layout.html.twig” %}{% block main %} <div id=”error404″><h2>{{ app.translator.trans(‘page404.title’) }}</h2><

  • Martin
    php symfony2 silex
    I can’t figure out how to use SecurityServiceProvider in Silex. My configuration is:$app[‘security.firewalls’] = array(‘admin’ => array(‘pattern’ => ‘^/_admin/.+’,’form’ => array(‘login_path’ => ‘/_admin/’, ‘check_path’ => ‘/_admin/login_check’),’logout’ => array(‘logout_path’ => ‘/_admin/logout’),’users’ => array(‘admin’ => array(‘ROLE_ADMIN’, ‘5FZ2Z8QIkA7UTZ4BYkoC+GsR…’),),), ); $app->register(new Silex\Provider\SecurityServiceProvider());This just throws:Fatal

  • Pete
    php symfony2 twig silex
    My site is logging uncaught exceptions when users try routes that don’t exist. The log looks like this:[2013-05-30 15:47:38] myapp.ERROR: Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for “GET /a/made/up/url” (uncaught exception) at /home/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php line 92 [] []Is this normal? Or is there some way that I should be catching the exception?My error handling code looks like this:$app->err

  • Matt
    php silex
    I’m working on a new Silex project and am having trouble mounting a route to my Controller providers. I have successfully done this before in another project, but now when I put the following routes in app.php:$app->mount(‘/’, new CommonController()); $app->mount(‘/feeds’, new FeedsController()); $app->mount(‘/admin’, new AdminController());I receive a fatal error: Fatal error: Call to undefined method Silex\Route::setPath() in [root]/vendor/symfony/routing/Symfony/Component/Routing/Rou

  • Gerry
    silex
    I created a custom user class with a custom userProvider based on following linkI’m unable to create a Service for the User Provider.$app->setParameter(‘webservice_user_provider.class’,’Tac\WebserviceUserBundle\Security\User\WebserviceUserProvider’ ); $app->setDefinition(‘webservice_user_provider’,new Definition(‘%webservice_user_provider.class%’) );Fatal error: Call to undefined method Silex\Application::setParameter() in http://content.api.com/Users/davyd/Sites/content_api/src/boot.php o

  • Mathias-Dev
    session symfony2 silex
    What should I check to solve this problem?Everything works fine in development, but putting my code on my web site provider (in production) gives me this error:RuntimeException: Failed to start the session because headers have already been sent. in …/vendor/symfony/http foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php line 142UPDATE 1 Once the SessionServiceProvider as been registered, do we have to call manually app[“session”]->start()?This is an extr

Originally posted 2013-11-27 11:59:12.