Snappy – How to create PDF with Symfony and twig

Long time ago I use FPDF to create PDF Documents and reports. FPDF allows you to define a PDF using blocks. This process is slow as you can not reuse any of the views you already code in html or your frontend components.

For a long time there has been a new player wkhtmltopdfwkhtmltopdf is a headless chrome port that generate PDF’s or Images from a website and you can use it in Symfony with Snappy bundle.

Continue reading

XDebug and PHP setup for Mac OSX

Debugging PHP it shouldn’t be painful. XDebug it’s a fantastic PHP extension that provide debugging capabilities. The setup procedure it is easy and it already comes ready to go on XAMP and WAMP.

Let’s start for the mistake when someone try to “debug” a code for the first time. When you are digging into unknown behavior in your code you are running web server while you edit your code and press F5 compulsively. Add a die there, var_dump there and see if there is what you expect until you found something unexpected and start following that clue again. Continue reading

PHP and Symfony certification study guides

This post is a collection of useful links I found to become a better php professional. There is no other aim to have it available for me to check it when I have spare time so it’s not proper written and documented. I write this, by this I mean this blog, as an open public notebook where people can learn, correct and give me and others some tips.

If you are learning PHP or improving your knowledge, you can found this post quiet interesting.  Continue reading

AWS S3 & PHP & Gaufrette

When your application is growing there are times in which you have to share your data between more than one App server. There are lots of different tools that allow you to sync or replicate data between multiple servers but nowadays it’s a better choice to save your data outside of your “app server”.

In order to achieve this, you should use a storage service. It can be an FTP or an external service with it’s own API like Amazon Web Service Simple Storage Service (better known as S3), Azure Blob Storage, Rackspace Cloud Files or any of the many other solutions available.

Continue reading