Posted by: phillipnb | October 5, 2013

Multiple Choice Questions in Symfony Framework (Symfony2)


1).The Request class symfony is a simple object-oriented representation of the
a).HTTP request message b).HTML request message c).PHP request message d).TCP request message

2).In symfony, the code where you interpret the request and create a response is the
a).Request b).Controller c).Router d).Interpreter

3).In Symfony, the routing configuration can be written in
a).YAML b).PHP c).XML d).All of the above

4).Symfony2 packages called ____________, which are fully functional applications that include the Symfony2 core libraries, a selection of useful bundles,
a sensible directory structure and some default configuration.
a).distributions b).binaries c).core libs d).composer

5).A _____ defines the URL (e.g. /about) to your page and specifies a controller (which is a PHP function) that Symfony2 should execute
when the URL of an incoming request matches the route path.
a).path b).home path c).route d).controller path

6).A controller in Symfony is a
a).a YAML function b).a PHP function c).a XML Config file d).None

7). Which of the following returns Symfony2 Response object back to the user?
a).Bundle b).Kernel c).Controller d).Model

8).Which of the following in Symfony is a directory that houses everything related to a specific feature, including PHP classes, configuration, and
even stylesheets and Javascript files?.
a).Bundle b).Router c).COntroller d).Model

9).In Symfony, to create a bundle called AcmeHelloBundle, which of the following command need to be run?
a).$ php app/console generate:bundle –namespace=Acme –format=yml
b).$ php app/console generate:bundle –namespace=”/HelloBundle –format=yml
c).$ php app/console generate:bundle –namespace=AcmeHelloBundle/HelloBundle –format=yml
d).$ php app/console generate:bundle –namespace=Acme/HelloBundle –format=yml

10).By default, the routing configuration file in a Symfony2 application is located at
a).app/config/routing.yml
b).app/yaml/routing.yml
c).app/config_route/routing.yml
d).app/config/routing.config

11).In Symfony, The routing consists of two basic pieces: the _____, which is the URL that this route will match, and
a defaults array, which specifies the ________ that should be executed.
a).path,controller
b).route,controller
c).path,router
d).router,controller

12).The end product of a controller in Symfony is always the same – what is it?
a).a Symfony2 Response object
b).a Symfony2 Presentation object
c).a Symfony2 Request object
d).a Symfony2 HTML object

13).The controller in Symfony creates a new Response object, whose first argument is the
a).content that should be used in the request
b).content that should be used in the response
c).a PHP file that should be used in the request
d).3 arguments that should be used in the response

14).In order to use the render() method in Symfony, your controller must extend the
a).Router Class b).Config Class c).Render Class d).Controller class

15).The goal of each controller in Symfony is to return a
a).Response object b).Request Object c).PHP Object d).None

Answer Key

1.a 2.b 3.d 4.a 5.c
6.b 7.c 8.a 9.d 10.a
11.a 12.a 13.b 14.d 15.a
Advertisements

Responses

  1. Great, the set of questions are very useful for all .

    PS: Controller is supposed to be mentioned as a class rather than a PHP function. ref: questions 5 and 6.

    [http://symfony.com/doc/current/quick_tour/the_big_picture.html]

    [In Symfony applications, controllers are usually PHP classes whose names are suffixed with the Controller word. In this example, the controller is called Default and the PHP class is called DefaultController.

    The methods defined in a controller are called actions, they are usually associated with one URL of the application and their names are suffixed with Action. In this example, the Default controller has only one action called index and defined in the indexAction() method.]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: