Posts tagged "Codeigniter"

Updating CI Twig After 12 Years

I recently pushed an update to CI Twig, a Codeigniter library I created back in 2012 for integrating the Twig templating engine. Twelve years. That’s older than some of the junior developers I’ve worked with. It’s wild to think that something I built when I was still figuring out what I was doing has been sitting there on GitHub this whole time. CI Twig was one of my first proper open source contributions. Not my first bit of code on the internet, but one of the first things I put out there with the intention of other people actually using it. I remember being nervous about it. What if my code was rubbish? What if someone found a bug and called me out? What if nobody used it at all?

Using Smarty 3 in Codeigniter 2 (a really tiny CI library)

Codeigniter is an awesome framework, it’s idea of a parser library that ships with it is not. I have written a simple library that extends Codeigniter’s native view loading to allow you to use Smarty 3 in your Codeigniter projects to render your views. Requirements: Codeigniter 2.0 as this library uses the core and third_party folders, although with some changes it will work with 1.7.2 / 1.7.3 versions of Codeigniter. Features: Extends native Codeigniter view loading so you can still use $this->load->view() to load your templates. This also means that if your Codeigniter application is using $this->load->view() you won’t need to change any of your code to use this library. Allows you to use Smarty specific features including template inheritance inside of your views. Uses your views directory for loading templates but the location of views can be changed if you don’t use the standard CI views folder. Comes bundled with the latest version of Smarty already. Install: Copy all of the files from the download zip off the repo into your application directory. Then you should be able to just load Smarty views using the native $this->load->view() notation.