In this post you can find Complete and recently updated Correct Question and answers of Symfony2. All Answers updated regularly with new questions. Upwork
test answers of 2016.
Question:* In regard to validating the data that is entered in forms, which of the following constraints is NOT supported by Symfony2?
Answer: • EqualTo
Question:* Which of the following is a common element of a bundle?
Answer: • (all of these)
Question:* What are the three parts of the logical controller name?
Answer: • bundle:controller:action
Question:* Select the sequence that shows an example of a simple controller.
Answer: • // src/Smarterer/HelloBundle/Controller/HelloController.php namespace Smarterer\HelloBundle\Controller; use Symfony\Component\HttpFoundation\Response; class HelloController { public function indexAction($name) { return new Response('<html><body&g
Question:* Which of the following methods allows you to progress to another controller internally?
Answer: • forward()
Question:* Where is the AppKernel class stored?
Answer: • The app/ directory
Question:* Which of the following directories contains any publicly accessible files?
Answer: • web/
Question:* The ________ class is a simple object-oriented representation of the HTTP request message.
Answer: • Request
Question:* Which of the following lets you write templates more quickly as well as makes them easier to read?
Answer: • Twig
Question:* Which of the following field types are supported in Doctrine?
Answer: • All of these
Question:* The __________ allows you to begin using PHP classes without including the file containing the class.
Answer: • autoloader
Question:* Choose the best description of the following configuration: secure: path: /secure defaults: { _controller: SmartererDemoBundle:Main:secure } schemes: [https]
Answer: • It forces the secure route to always use HTTPS
Question:* Where is the routing configuration file located?
Answer: • app/config
Question:* How do you disable CSRF protection?
Answer: • Set csrf_protection to false
Question:* Which of the following is a Doctrine field type for numbers?
Answer: • integer
Question:* A directory that contains a set of files that represents a particular feature is known as a/an:
Answer: • Bundle
Question:* What are the 3 environments a Symfony2 project BEGINS with?
Answer: • test, dev, and prod
Question:* Which of the following Components contain the Request and Response classes?
Answer: • HttpFoundation
Question:* Which of the following methods is used to generate a URL for a given route?
Answer: • generateURL()
Question:* What class is used by the front controller to bootstrap an application?
Answer: • AppKernel
Question:* What Symfony2 environment is used to run unit tests?
Answer: • test
Question:* In order to use your controller from the service container you need to register it as a service. Where can this be done?
Answer: • Locally in the bundle in the Resources/config/services.yml
Question:* What is the purpose of the _controller parameter in routing?
Answer: • It tells Symfony which controller should be executed when a URL matches a specific route
Question:* True or False? The HTTP response from a controller is limited to 404 errors, XML documents, and HTML pages.
Answer: • False
Question:* What tag is used for template inheritance?
Answer: • {% extends %}
Question:* is it possible to define a form like a service ?
Answer: • TRUE
Question:* What is a PHP function that takes incoming requests and transforms them into a response?
Answer: • controller
Question:* Which of the following methods checks the 3 different values in PHP that can show whether or not the user is connecting via a secured connection?
Answer: • isSecure()
Question:* True or False? The directory that contains all of the pieces of code that run your application is called the src/ directory.
Answer: • True
Question:* Security is a two-step process, the first being Authentication?
Answer: • True
Question:* Which of the following Components allows you to trace a specific URI to a description of how it should be handled?
Answer: • Routing
Question:* Symfony2 is only supported on:
Answer: • PHP 5.3.3 and up
Question:* What defines a URL to a page?
Answer: • route
Question:* True or False? The Symfony2 Framework can be altered to one's preferences or replaced entirely.
Answer: • True
Question:* What are the 2 options you have to install a Symfony2 distribution?
Answer: • Use Composer or Download an Archive
Question:* In regard to routing, which of the following best describes a route?
Answer: • A map from a URL path to a controller
Question:* True or False? To build a form in Symfony2 you must build a form object and then render it in a template.
Answer: • True
Question:* Which of the following methods is a shortcut to direct use of the templating service?
Answer: • renderView
Question:* To delete an object in Doctrine you must use the _________ method of the entity manager.
Answer: • remove()
Question:* How would one use a service in a controller in Symfony?
Answer: • $this->get('name_service');
Question:* Which of the following allows you to manipulate assets however you like before serving them?
Answer: • Assetic
Question:* Is a "front controller" the same as the "controllers"?
Answer: • False
Question:* _______ is a container for key/value pairs.
Answer: • ParameterBag
Question:* Choose the best description of the following sequence (where //LINE BREAK// indicates a new line in the sequence): # app/config/config_test.yml //LINE BREAK// # ... //LINE BREAK// swiftmailer: /linebrea //LINE BREAK// disable_delivery: true
Answer: • It shows the swiftmailer is NOT configured to deliver emails in the test environment
Question:* what is repository in Symfony ?
Answer: • a class that work with entity for processing data
Question:* The Dependency Injection component allows you to
Answer: • Standardize and centralize the way objects are constructed in your application
Question:* Choose the best reason why the following autoloading sequence will not run properly: Class Name: Smarterer\HelloBundle\Controller\HelloController Path: src/Smarterer/Controller/HelloController.php
Answer: • The class name and the path to the file do not follow the same sequence
Question:* A __________ is a short PHP script that lives in the web directory of your project.
Answer: • Front Controller
Question:* In regard to testing, each time you make a request with the client a ______ instance is returned.
Answer: • crawler
Question:* Which of the following shows the correct representation of the Twig function?
Answer: • public function renderResources() { return $this->container->get('templating') ->render("RSmithNotificationBundle:Notification:resources.html.twig"); }
Question:* If you wanted to add routes to an application without including them in the Yaml file, which of the following would you need to use?
Answer: • Custom route loader
Question:* What is the specific workflow of Functional Tests?
Answer: • 1. Make a request 2. Test the response 3. Click on a link or submit a form 4. Test the response 5. Rinse and repeat
Question:* what is the first file that Symfony framework runs at startup for loading libraries ?
Answer: • app/autoload.php
Question:* Which of the following is the correct way to create a basic route configuration?
Answer: • _welcome: path: / defaults: { _controller: SmartererDemoBundle:Main:homepage }
Question:* Which of following console commands checks for syntax errors in Twig templates?
Answer: • twig:lint
Question:* Which parameter is not available in security.yml ?
Answer: • All of these are available
Question:* Which of the following is correct when creating a bundle using the command line generator?
Answer: • php app/console generate:bundle --namespace=RSmith/Bundle/NotificationBundle --bundle-name=RSmithNotificationBundle
Question:* True of false: A controller is required when creating a static page.
Answer: • False
Question:* Which configuration format is powerful but less readable than standard configuration formats?
Answer: • PHP
Question:* In which of the following can the configuration of services in symfony be found?
Answer: • app/config/config.yml
Question:* What is the way around configuring the default charset and collation inside Doctrine?
Answer: • Configure server level defaults
Question:* Which of the following Twig codes is valid to check if a variable has the same value and the same type as another ?
Answer: • {% if a is sameas(b)) %}
Question:* Which of the following is an authorization layer of the security component?
Answer: • Voters
No comments:
Post a Comment