Questions tagged [silex]

Silex is a PHP microframework for PHP >=5.3. It is built on the shoulders of Symfony2 and Pimple and also inspired by Sinatra.

Silex is a PHP microframework for PHP. It is built on the shoulders of and and also inspired by .

As of March 2018, the latest stable release of Silex is 2.2.3. For actual improvements check out the changelog.

Silex became end-of-life in June 2018 and is not maintained anymore. Its advised to now use symfony 4 and flex to replace Silex. More information here: https://symfony.com/blog/the-end-of-silex

Information

A microframework provides the guts for building simple single-file apps. Silex aims to be:

  • Concise: Silex exposes an intuitive and concise API that is fun to use.
  • Extensible: Silex has an extension system based around the Pimple micro service-container that makes it even easier to tie in third party libraries.
  • Testable: Silex uses Symfony's HttpKernel which abstracts request and response. This makes it very easy to test apps and the framework itself. It also respects the HTTP specification and encourages its proper use.

Useful links

1363 questions
-1
votes
3 answers

Route defined in Silex but 404 error

I use Silex framework in my project. I defined a road / login that points to my form of authentication to connect to the app but when I do: ipsrv / login (ipsrv being the ip web server) he does not know the road (404 ). My app.php file…
DARLAIVE
  • 1
  • 4
-1
votes
1 answer

Silex and fputcsv issue

I'm having an issue trying to create a downloadable CSV through PHP and Silex. This is what I have as of now header('Content-Type: text/csv; charset=utf-8'); header('Content-Disposition: attachment; filename=csv.csv'); $output =…
Stefano
  • 57
  • 5
-1
votes
1 answer

extend Twig to define assets url

I read the Silex Cookbook for Managing Assets in Templates http://silex.sensiolabs.org/doc/cookbook/assets.html and write this code in my app/app.php : $app['twig'] = $app->share($app->extend('twig', function ($twig, $app) { …
MajAfy
  • 3,007
  • 10
  • 47
  • 83
-1
votes
1 answer

HHVM compatibility with the Silex framework

I can see that HHVM can already run some well known PHP frameworks. I was wondering if anyone tried to run Silex with HHVM, hands on experience? Are they compatible? I'm asking since I can see that currently Symphony passes 98% of unit-tests on…
Paul
  • 20,883
  • 7
  • 57
  • 74
-1
votes
1 answer

Silex add web profiler toolbar to all request

In my silex application I have monolog, and profiler working together and am using https://github.com/silexphp/Silex-WebProfiler for the web profiler provider. I can access the data by going to the routes it mounts but I would like to add the…
Yamiko
  • 5,303
  • 5
  • 30
  • 52
-1
votes
1 answer

Create a Service for the User Provider

I created a custom user class with a custom userProvider based on following link I'm unable to create a Service for the User Provider. $app->setParameter( 'webservice_user_provider.class', …
-2
votes
1 answer

use node js in a php framework

I'm currently using the silex micro-framework on my project and recently discovered node js to include socket.io to my project. My question is, how can i use both of those technologies in my project ? I found a few answers on the web but nothing…
Azoulay Jason
  • 2,787
  • 5
  • 21
  • 46
-2
votes
1 answer

Silex add Routing file with all the routes to controllers

im using silex to create my API REST. In a example, i found a way to create the routes $api = $this->app["controllers_factory"]; $api->get('/notes', "notes.controller:getAll"); $api->get('/notes/{id}',…
raleandri
  • 23
  • 6
-2
votes
1 answer

how would I add a twig sub-function or shortcut to translate text

I'm trying now to get a subfunction going. Now I am using {{ app.translator.trans('keyword')|filters }} To get my i18n translations going, to avoid the usage of hardcoded text, most of the application text runs on yml…
JLChafardet
  • 59
  • 1
  • 14
-2
votes
1 answer

Is there a GearmanProvider for Silex?

I am looking for a provider thats gives me the ability to use Gearman with my Silex application. I have found https://github.com/skeetr/silex but it seems that this provider is too old and it uses pecl_http instead of curl. Does anyone know a better…
Roman
  • 2,530
  • 2
  • 27
  • 50
-3
votes
1 answer

Silex Framework, no route found for POST

I have a little problem with the silex framework (I'm quite sure, that it's caused by Silex).. I have a form and want to submit it with POST, but Silex throws the following exceptions: MethodNotAllowedException in UrlMatcher.php line…
nameless
  • 1,483
  • 5
  • 32
  • 78
-3
votes
2 answers

PHP array to jQuery, using json_encode: &qout; instead of "

I am trying to send a php array to jquery This is my array before json encode: Array ( [0] => 30-Dec [1] => 31-Dec [2] => 1-Jan [3] => 2-Jan [4] => 3-Jan [5] => 4-Jan [6] => 5-Jan [7] => 6-Jan ) This is it after the json…
Kylian
  • 29
  • 6
-4
votes
1 answer

Redirect to 404 when page does not exist

I need write some code in Silex. I have template, witch tell user when route doesn't exist. How do it in Silex? Maybe somebody faced with it?
Taylor Beear
  • 93
  • 1
  • 10
1 2 3
90
91