If you are a web developer then you might have heard something called as “Symfony“. So what is this Symfony? Framework? Language? Tool? or something else? Let’s have a quick look on this.
What is Symfony?
Symfony is nothing but a set of reusable PHP components, a web application framework. Symfony is a leading PHP framework, which has a large user base and used to create websites and web applications.
Symfony is basically set of components. Depending on your needs, you can either choose individual component, you can choose set of components or you can go with full framework. Before going to Why Symfony? Let’s first see why you should use a Framework?
Why should you use Framework?
Of-course, Framework is not absolutely necessary for developing a website or a web app. But framework provides an efficient way to create and develop website and web apps. At the small-scale, you may feel that frameworks are not that much useful, infact in development of small apps you will find that these frameworks do adds a lots of extra complexity and hence time and efforts. But when you consider a large app, lets say site like Ebay which deals with 1000’s of products, these frameworks reduces the complexity at great extent and make those websites and apps manageable. Apart from that these framework also provides a lot of reusable components, code which reduces time of development and avoid unnecessary duplication of code.
Again there are lots of frameworks. But each one differs from each other in terms of functionality, compatibility and efficiency. Some frameworks works best with small applications, some of them works best with large-scale applications, some of them works with database based applications and so on. But Symfony is exceptional. It works best with all cases. With Symfony you can create small-scale website, large-scale apps, API’s, data centric applications and lots more.
So how to quick start with Symfony?
Simply head over to symfony.com and click on download button. Now you will see two options for download. You can either use Composer to set up Symfony or you can go with Quick test drive version of Symfony. Again Symfony is distributed in two different versions. One is with long-term support, you can use this if you are developing app with long-term vision while another one is with latest features. Again there is one more option, which allows you to download components of Symfony individually.
Tl;dr: You can simply click here to download quick test drive version of Symfony 2.
Quick test drive!
The zip file that you have downloaded right now is consists of one folder named ‘Symfony’. You have to extract content of that folder in your web directory (of-course you will need a web server with PHP support like WAMP), not the folder itself. I would like to suggest you, first create a folder in your web directory and extract content there. Lets say here in this tutorial, I am using WAMP, I have created a folder named “symfony-test” in www i.e. in WAMP’s web directory and I will be extracting the content of zip file in that folder.
So now the directory structure will be like; first www, inside www you will have symfony-test and inside that folders like app, bin, src etc, that you have extracted from zip.
[email protected] /d/wamp/www/symfony-test $ ls LICENSE UPGRADE-2.2.md UPGRADE-2.4.md app composer.json src web README.md UPGRADE-2.3.md UPGRADE.md bin composer.lock vendor
Now simply you have to navigate to “http://localhost/symfony-test/web/app_dev.php/”. If everything is right then you will see Welcome page. That’s all. You have done setting up Symfony.