silex Questions

4

Solved

Is it possible to directly access an array index from within a Twig template? Here's my setup, using Silex: return $app['twig']->render('template', array('numbers' => array('one', 'two', 't...
Homogenize asked 7/8, 2012 at 10:23

2

Solved

What is the difference between use and include in Twig? Documentation: include The include statement includes a template and returns the rendered content of that template into the current on...
Allopathy asked 10/11, 2016 at 11:53

5

Solved

I have an array of user records (0 indexed, from a database query), each of which contains an array of fields (indexed by field name). For example: Array ( [0] => Array ( [name] => Fred ...
Synergetic asked 17/1, 2017 at 16:49

3

Solved

I don't have a specific problem, just looking to deepen my understanding of what's going on with Silex and with some new-ish PHP features in general. This is based off the code samples on the "usag...
Serial asked 6/4, 2013 at 14:56

2

Solved

I have a basic silex application, and I try to test it using HTTPie. Yet when posting using: http POST http://localhost:1337 data="hello world" The data, that I get from the Request object via: ...
Dryad asked 14/10, 2015 at 15:5

6

Solved

We have narrow down our search between Silex and Slim PHP frameworks for routing our REST APIs on our Apache/PHP/MySQL Server. Both seem to have good reviews. Silex has probably a bigger community...
Moonlight asked 29/10, 2015 at 9:9

8

Solved

I would like to try Silex but i've some questions. I know to use Symfony2 and i would like to know if Silex is very different of Symfony or it's the same thing (same operation, same code... ) ? M...
Kuska asked 29/6, 2012 at 23:6

3

Solved

According to the Silex documentation: Symfony provides a Twig bridge that provides additional integration between some Symfony2 components and Twig. Add it as a dependency to your composer.json ...
Seumas asked 30/9, 2013 at 11:2

2

Solved

I'm having trouble validating a value to allow NULL but not an empty string with the Symfony2 validator component. I've integrated the component in a Silex application and used the Property Constr...
Umbilicus asked 13/4, 2012 at 8:20

3

I just need to autoload some classes, and I don't like the psr-0 namespace insanity (no offense). This used to work just fine in my project: "psr-0": { "": [ "app/controller/", "app/model/" ]...
Jurist asked 28/7, 2013 at 17:4

4

Solved

I am using Silex and Twig for a website and I want to allow the user to change the langage of the site. My problem Right now, it works if I change the locale in the URL : /my-account: my page co...
Auraaural asked 1/3, 2018 at 17:15

3

Solved

My question: How do I permit use of debug in Twig templates within Silex? I'm playing around with the Silex micro-framework (a PHP framework that leverages Symfony). When using the Twig templa...
Dynamoelectric asked 8/2, 2012 at 15:29

2

Solved

I have a problem with TWIG. This code works at school but absolutely not with my laptop. I tried with a simple code but I have the error: Catchable fatal error: Argument 1 passed to Twig_Filter...
Guatemala asked 26/1, 2017 at 18:6

5

Solved

I'm using Silex and can't use the is_granted function in a template. I can't find anything in the docs about why this isn't working. Any hints? $app->register(new Silex\Provider\SecurityService...
Creaturely asked 24/10, 2012 at 19:15

2

Solved

I am searching for an easy way to add a bundle of fields to each form. I have found a way to extend the AbstractType and use the buildForm method to add more fields. When creating the form I give ...
Dextro asked 14/3, 2014 at 19:32

2

Solved

I wonder how can I see syntax errors like this (missing semicolon): <?php var_dump($app) ?> This will cause a WSOD (white screen of death). I tried to include a debug config file which lo...
Schuyler asked 26/4, 2014 at 19:47

1

Solved

I'm doing some programming in Silex with the symfony components and I think I have found a bug with the symfony/serializer and the symfony/validator components. First let me explain what I'm train...
Sindysine asked 6/2, 2017 at 18:35

2

I want a simple way to access $app and $request in my controller classes. The document says to do this, public function action(Application $app, Request $request) { // Do something. } but it do...
Snapshot asked 10/7, 2013 at 4:35

3

Solved

In Pimple 1.0 I used to be able to share class instances like this: $app['some_service'] = $app->share(function () { return new Service(); }); This now seems to be deprecated and I am unable...
Toothwort asked 12/1, 2016 at 19:53

2

Solved

I am trying to use Doctrine ORM with Silex, and finding it an altogether frustrating experience, due to the lack of consistent documentation. When I run vendor/bin/doctrine at the console, I get t...
Class asked 26/5, 2015 at 13:16

3

Solved

Let my application run on localhost, the path is: localhost/silex/web/index.php, defined routes as in the code below, I'd expect visiting localhost/silex/web/index.php/redirect redirects me to loca...
Habitual asked 3/3, 2014 at 9:20

2

Solved

First of all, I just want to mention that this is not an "issue" at all. Deleting with Doctrine DBAL is not a problem and I am able to do it. What I actually wanted to know is if there is way to d...
Abduce asked 10/7, 2015 at 10:1

3

Solved

Is it possible to configure a Silex Application with YAML config files? I bet yes, but how is it done correctly? For instance I want to use different configurations according to the environment, li...
Conjunct asked 20/9, 2011 at 14:13

2

Solved

I am trying to write some tests for Silex using phpunit. I have a class Symfony\Component\BrowserKit\Client that generates a Crawler object. This object expects the results of the client to be xh...
Gridley asked 18/9, 2012 at 9:50

2

Solved

I am using Silex 2 and I would like to redirect to homepage with default locale if any url is loaded using an invalid locale. // homepage / root $this->get('{_locale}/', function (Request $re...
Martino asked 19/8, 2016 at 8:57

© 2022 - 2025 — McMap. All rights reserved.