Tag: php

  • Quick Twig Template Rendering Without Much Set Up

    Sometimes, I want to prepare more readable output from my PHP scripts. It is good to create a template and render with values from script out put. Here is a quick way to render a twig template. First lets assume the HTML twig template (test-report.html.twig) is: Then we have this script, test-script.php: Keeping above two […]

  • Fixing gd Problem in PHP on Ubuntu 11.04

    I was trying to enable gd for PHP in Ubuntu 11.04. As usual it should be typing in terminal: Unfortunately it does not worked and gd was not enabled. Typing the command php -a I was getting: PHP Startup: Unable to load dynamic library ‘/usr/lib/php5/20090626+lfs/gd.so’ – /usr/lib/php5/20090626+lfs/gd.so: undefined symbol: gdImageCreateFromJpeg in Unknown on line 0 […]

  • Resource Loader for PHP Web Applications

    I wrote a resource loader class for PHP web applications. The class will help to manage loading of JavaScripts and CSSs we include within our web pages. Usually these JavaScripts and CSSs have dependencies with other scripts and or CSSs. For example, we have to load jQuery script file before any script that utilize jQuery […]