Custom function making using Twig with CodeIgniter 3 in PHP
<?php defined ( 'BASEPATH' ) or exit ( 'No direct script access allowed' ); class Welcome extends CI_Controller { public function __construct () { parent :: __construct (); $this -> load -> helper ( "twig" ); } public function index () { $data = [ 'title' => 'Welcome to CodeIgniter with Twig' , 'message' => 'This is a sample page using Twig as the template engine.' , "items" => array ( array ( "name" => "Item 1" , "description" => "This is item 1" ), array ( "name" => "Item 2" , "description" => "This is item 2" ), ...