Symfony Best Practices

Here is a consolidated version of symfony best practices taken from These best practices are for version symfony 2.7.

Creating the Project

  • Use the Symfony Installer to create new Symfony-based projects.
  • Create only one bundle called AppBundle for your application logic


  • Define the infrastructure-related configuration options in the app/config/parameters.yml file.
  • Define all your application’s parameters in the app/config/parameters.yml.dist file.
  • Define the application behavior related configuration options in the app/config/config.yml file.
  • Use constants to define configuration options that rarely change.
  • Don’t define a semantic dependency injection configuration for your bundles.

Moving Your Git Repository

This is an easy way to move your Git repository from one repository to another while maintaining history. I use this method to move repositories from BitBucket to GitHub or visa versa.


I will be moving a repository from a BitBucket repository ( to a GitHub repository (

  1. git remote add bitbucket  #Add a new temporary remote just in case
  2. git remote rm origin #Remove the old origin
  3. git remote add origin  #Adds a new origin that points to GitHub
  4. git push -u origin #Push the commits to the new repository
  5. git remote rm bitbucket #Remove the temporary remote

That’s all there is to it!


Color Schemes for Charts and Graphs

Most of the web applications that I create are dashboards that help display complicated data in a meaningful way. One of the challenges with creating dashboards is deciding which colors to use for the different data items so that the charts on the dashboard are meaningful and look good. The colors not only need to look good together but also have to be easy enough to differentiate so that the data displayed in meaningful to the user.

After doing some searching, I came across some color schemes for charts and graphs that have really helped me with choosing colors for the charts on the Dashboards I create.

Hex color codes are displayed for each color. You can also get the RGB code by hovering over each color.

Hopefully this information will be useful to someone else also.

The three groups of color schemes are SAP ColorsColor Brewer, and Microsoft Excel color palettes.

Using OutputCache in ASP.NET MVC

You can increase the performance of your ASP.NET web applications by taking advantage of the output caching mechanism that is available for ASP.NET. By using caching, you can return a result from a controller action without having to recreate the content each time a user invokes that action.

The [OutputCache] Attribute

Before talking about how to use the [OutputCache] attribure, lets go over some the settings that can be used.

   Location="Any | Client | Downstream | Server | None | ServerAndClient "
   VaryByCustom="browser | customstring"
   CacheProfile="cache profile name | ''"
   NoStore="true | false"
   SqlDependency="database/table name pair | CommandNotification")