Monthly Archives: May 2011

Twig library for CodeIgniter 2.x

I’m trying to catch up with this social open source movement. I forked an existing CodeIgniter Twig integration library and added some changes to work with CodeIgniter 2.x.

Also I found a way map any CodeIgniter function to Twig like so.

$this->load->library('twig'); // load the Twig library
$this->load->helper('url'); // load the CodeIgniter URL helper
// map the base_url() function as a Twig function
$this->twig->add_function('base_url');

Then in your Twig view call the base_url() function like this

{{ base_url() }}

Head over to Github for more details.

In case you have no idea what I’m talking about. CodeIgniter is an excellent PHP framework and Twig is a Django style templating engine with inheritance for PHP.

Getting started with HTML5

HTML5 logo

I did a small intro to HTML5 at the last Refresh Colombo meetup last week. Here is the main presentation I used from html5rocks.com.

Here is a better list of resources as well. I specially like Dive Into HTML5 by Mark Pilgrim.

I met @geekaholic and @SeeJay of SinhalenFOSS at Refresh Colombo but had to head back soon after.

Thanks @nazly for the invite will try to hang around longer next time. :)

Update: Mark Pilgrim’s websites went away. I’ve changed the above link to a working mirror. Also you can get a PDF of the book from this site.