Symfony – Interview and Multiple Choice Questions
1). Tell me in a few sentences what Symfony is all about?
2). What is the difference between PHP and Symfony?
3). Does Symfony have a Controller?
4). Which of the following contains whatever arbitrary logic your application needs to render the content of a page.?
a). Router b). Routing c). Controller d). Bundle
5). Controllers are also called as ______
6). What are the common tasks performed by a Controller in Symfony?
7). What is the goal of routing in Symfony2?
8). Which of the following is an example for a routing config file in Symfony2?
a). app/config/routing.yml b). app/system/routing.yml c). system/system/routing.yml d). kernel/config/routing.yml
9). When Symfony denies the user access, what happens?
10). In Symfony, the most basic way to secure part of your application is to secure an entire URL pattern. Is this true/false?
11). The Symfony2 validator is _____ by default?
a). Disabled b). Enabled c). Hidden d). All of these
1). Just explain what Symfony framework is all about.
2). Focus on explaining PHP as a scripting language while Symfony is a framework.
If you write in plain PHP you cannot reuse that code whereas the opposite when we use Symfony. Symfony2 fully integrates Doctrine, a library dedicated to database abstraction and mapping which is not there in plain/flat PHP.
3). Yes, Symfony framework has a controller.
A controller is a PHP function you create that takes information from the HTTP request and constructs and returns an HTTP response. The response could be an HTML page, an XML document, a serialized JSON array, an image, a redirect, a 404 error or anything else.
6). A controller can do virtually anything. Some of the basic tasks done by a controller are redirecting, forwarding, rendering templates and accessing core services.
7). The goal of the Symfony2 routing system is to parse a URL and determine which controller should be executed.
9). When Symfony denies the user access, the user sees an error screen and receives a 403 HTTP status code