Skip to content

Dynamic content [closed]

My index page has a two column layout. In the left I have several icons (links) and in the right the dynamic content. Every time I click in one icon of the left I would like to show related …

Decoding JSON in Twig

Is is possible to decode JSON in twig? Googling doesn’t seem to yield anything about this. Does decoding JSON in Twig not make sense? I’m trying to access 2 entity properties on an Symfony2’s entity …

Check if specific input file is empty

In my form I have 3 input fields for file upload: How can I check if cover_image is empty – no file is put for upload? Answer You can check by using the size field on the $_FILES array like so: (I also check error here because it may be 0 if something went wrong. I wouldn’t use name for

Calling console command within command and get the output in Symfony2

I have a few console command in Symfony2 and I need to execute one command from another command with some parameters. After successfull execution of the second command I need to get the result (as an array for example), not the display output. How can I do that? Answer Here you can have a basic command inside…

Why is my Symfony route is not working?

I made a new Symfony2 bundle and deleted the Acme bundle. Then I created a new Controller (MainController.php): <?php namespace MyBlogBundleController; class MainController extends Controller {…

How can i secure this API in an APK file

I am currently developing an api for a website i run. The api will be used in a number of places, and one of those places is an Android app. It’s purpose is to allow users to login, and and download files. I have the api build, and it will be using HTTPS so all of the data is fine