Posts

Showing posts from July, 2024

Custom function making using Twig with CodeIgniter 3 in PHP

Image
  <?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" ),           ...

Custom functions making in Twig with Codeigniter 3 in PHP

Image
  <?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" ),           ...

Twig "Date" tag with CodeIgniter in PHP

Image
  <?php defined ( 'BASEPATH' ) or exit ( 'No direct script access allowed' ); class Welcome extends CI_Controller {     public function __construct ()     {         parent :: __construct ();         $this -> load -> library ( "twig" );     }      public function forLoop ()     {         $data = array (             "title" => "Welcome to Twig" ,             "title2" => "Hello Welcome to Twig, we are from forLoop function" ,             "title3" => "For Loop" ,             "title4" => "Date" ,             "title5" => "Current Date is : " ,             "items" => array (                 array ( "name" => "Item 1...

Twig "for loop" in CodeIgniter in PHP

Image
<?php defined ( 'BASEPATH' ) or exit ( 'No direct script access allowed' ); class Welcome extends CI_Controller {     public function __construct ()     {         parent :: __construct ();         $this -> load -> library ( "twig" );     }      public function forLoop ()     {         $data = array (             "title" => "Welcome to Twig" ,             "title2" => "Hello Welcome to Twig, we are from forLoop function" ,             "title3" => "For Loop" ,             "title4" => "Date" ,             "title5" => "Current Date is : " ,             "items" => array (                 array ( "name" => "Item 1 is Pre...