Install Twig (views template) in Slim Framework

Okay from latest post, I created a tutorial about how to use slim framework/first install slim framework. And now I want to share how to install twig for views template in slim. But how to do it?
Okay frist open your slim framework again, and open file composer.json and change to be like this:

    "require": {
        "slim/slim": "~2.6",
        "slim/views": "~0.1",
        "twig/twig": "~1.0"


  1. Line 4 is the package to install twig/smarty in slimframework, more info read this
  2. Line 5 is to install core twig


Install and trying Slimframework

Hi and hallo. Long time I not write article again and now I back again with new article. Previously I using and learning laravel, and now Laravel has reached version 5. For now why I choose slim and not laravel again?

Because I want to use framework with small size and simple. Laravel is big framework (framework full stack). Laravel has many functions and features, but all unused by me and the features it becomes useless if not used.

So now I want share how to install and trying slimframework. The first, you must install composer. Follow this link After you success intall composer, now open slimframework site and follow installation guide from there. Or you can open cmd if you’re using windows and open terminal if you using Linux/unix and follow this instruction: