Question 1. What Is Symfony?
Symfony is a set of PHP Components and leading PHP framework to create websites and dynamic web applications.It follows MVC design pattern and released under the MIT License.
Question 2. Is Symfony Is Open Sourced Framework?
Yes, Symfony is open sourced Framework released under the MIT License.
Question 3. What Is The Latest Version Of Symfony?list Server Requirements To Install It?
Symfony 3.3 is the latest version of Symfony.
To install and run Symfony 3, your server must fulfill following requirements
- PHP >= 5.5.9
- JSON enabled
- ctype enabled
- date.timezone should be set (default timezone will not work)
Question 4. Which Template Engine Symfony Supports?
Symfony default template engine is Twig, however, your are free to use plain PHP code if you want.
Question 5. What Are Bundles In Symfony?
Symfony bundle are very similar to plugins or packages in other frameworks or CMS. In Symfony, everything is a bundle from core framework components to code you write.The bundle gives the flexibility to use pre-built features packaged in third-party bundles or to create and distribute your own bundles.
There are two types of bundles are available in Symfony :
- Application-specific bundles: only used to build your application.
- Reusable bundles: meant to be shared across many projects.
Question 6. Is Symfony Is Configuration Or Convention Based Framework?
Symfony is convention based Framework.
Question 7. How To Get The Current Route In Symfony Framework?
You can get current route in Symfony using $request->get(‘_route’); method.
Question 8. How To Get The List Of All Installed Packages In Composer?
composer show command is used to list all installed packages/dependencies of your current project.
Question 9. How To Set And Get Session In Symfony2?
SessionInterface object set and get method is used to set and get sessions in Symfony2.
Below look below example:
public function sessionAction(SessionInterface $session)
// store an attribute for reuse during a later user request
// get the attribute set by another controller in another request
$user_id = $session->get(‘user_id’);
Question 10. How To Get The Request Parameters In Symfony2?
$request->query->get(‘paraemeter_name’) method is used to get the request parameters in symfony2.
Question 11. What Is The Method Name In The Kernel Class To Enable Bundles In Symfony?
Kernel’s class registerBundles() method is used to enable bundles in Symfony.
Question 12. What Are Descriptors In Symfony?
Descriptors are objects to render documentation on Symfony Console Apps.
Question 13. Do Bundles Have Fixed Directory Structure In Symfony?
Question 14. What Rules Do You Follow At The Time Of Creating Methods Within The Controller In Symfony?
General rules for creating a method in within the controller in Symfony.
- Only action methods should be public.
- Controller methods should be short; if your controller is long, consider refactoring it.
- Action methods must have the “Action” suffix
- Action methods should return a valid response object
Question 15. How To Create A Symfony Application Using Composer?
Run below command in your console to install Symfony using Composer:
composer create-project symfony/framework-standard-edition my_project_name
PHP Interview Questions
Zend Interview Questions
PHP and Jquery Interview Questions
PHP+MySQL Interview Questions
PHP and Jquery Tutorial
Drupal Interview Questions
PHP Interview Questions
Sybase Interview Questions