Category Archives: Uncategorized

Symfony 2: Creating a Bundle

As discussed in this and this post, Symfony 2 is a web application framework. In Symfony 2 we organize our code in form of bundles. You can think bundle as collection of all code. Say if your app has a front-end, a back-end and an API then you can create three different bundles one for your front-end, one for your back-end and one for API. This will allow your to manage code efficiently.

Symfony 2 is flexible and it allows you to have as many as bundles you want in your app. Let’s understand this bundle system in detail by creating a bundle.

Continue reading Symfony 2: Creating a Bundle

Using Localhost For Facebook App Development

As a programmer you do develop every application on your machine first and then you test it on same machine and then you push it to remote test/production environment. You are developing a Facebook app and your requirement is user must login to use the app. Now you are ready with local environment, you have created a new project in your powerful IDE, you have downloaded the SDK, you are done with creating a new app in FB developer, now you are trying to add app domains to get access to FB’s oAuth API. Hmm….. Something went wrong!… Facebook is not allowing you to use ‘localhost’ as app domain. Now what to do? Here is solution.

Continue reading Using Localhost For Facebook App Development

Decompile, Edit, and Recompile Android Apps with APK Studio

If you have ever tried to modify precompiled android application, then you might be familiar with APKTool. APKTool is one of the most commonly used application to decompile and recompile android apk.

But there is a drawback with this APKTool. You can only decompile or recompile your apk, but you cannot edit the content, more specifically the source code. Generally the whole source code is compiled in .smali files and to edit that files you have to rely on some other compiler, decompiler and editor like Notepad++.

To combine all this things together and to make development easy, an XDA user, Vaibhav, created APK Studio.

APK Studio
APK Studio

As the name suggest, the APK Studio allows you to decompile, edit and recompile apk files right from one single app. This IDE looks quite similar to Netbeans IDE and has a lot of features to explore.

You can download this IDE from codeplex or XDA.

(Image credit: XDA)

Understanding Directory Structure of Symfony 2

Symfony 2 is a PHP framework. When you download it, if noticed, Symfony 2 has a directory structure. By default there are 5 directories like app, bin, src,vendor, web. If you had developed any kind of application with Symfony 2 then you might have followed something like put your source code in src, put all static assets in web, write config files in app etc. Again this directory structure is configurable, that means you can customize it according to your project needs. Even though the directory names are self-explanatory, let’s have a deeper look of this structure.

By default Symfony consists of following directories,

  • app/: The application configuration
  • src/: The project’s PHP code
  • vendor/: The third-party dependencies
  • web/: The web root directory


‘app’ directory in Symfony 2 holds the application configuration. You can find all configuration related stuff in ‘app/config’ folder. If you need to configure your database or Swiftmailer then you will need to change parameters/settings from here. Apart from that this directory holds the ‘cache’. While writing code in Symfony 2 you will be working with lots of files ranging from xml, yml to php, twig, html etc. Controllers will be written in some file, routes will be defined in some another files, views will be written in some other file and so on. So while serving request Symfony has to read all these necessary files. Since the count of files is too high, to achieve great performance Symfony 2 has inbuilt caching. And this cached data will be stored in ‘cache’ directory. Again there is a ‘log’ directory which has debugging related data, especially useful in development.

Continue reading Understanding Directory Structure of Symfony 2

Getting Started With Symfony 2: Quick Setup

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?

Continue reading Getting Started With Symfony 2: Quick Setup

Using CSS Variables

Nice to hear! Variables are finally available in CSS. You can declare variables in CSS with var-* prefix, such as

    var-pri-color: #0090f0;

With above code, we created a variable with name ‘pri-color‘ and it stores ‘#0090f0‘ as value. There is an important condition with CSS variables and that is, you must declare them under CSS-Selectors else they will not work. Since we want to use the variable globally, we nested it under html{} selector.

You can use this variable with var() method as shown in following code

body {  
    background-color: var(pri-color);  

Hence the whole code will be

    var-pri-color: #0090f0;
    background-color: var(pri-color);

(You will see blue background in following demo, if your browser supports CSS variables). Click here to load demo on new page.

See the Pen CSS Variables by Ankur (@asmhatre) on CodePen.