Tutorial by Examples: codeigniter

You will need to set your base URL in application/config/config.php If it is not set, then CodeIgniter will try to guess the protocol and path to your installation, but due to the security concerns the hostname will be set to $_SERVER['SERVER_ADDR'] if available, or localhost otherwise. The auto...
Placing date_default_timezone_set('Asia/Kolkata'); on config.php above base URL also works. PHP List of Supported Time Zones application/config.php <?php defined('BASEPATH') OR exit('No direct script access allowed'); date_default_timezone_set('Asia/Kolkata'); Another way I have found...
First thing to do is enable the mod rewrite on wamp go to Apache modules and scroll down the list If not showing tick enable it and then restart all servers. Linux users can also use below terminal command to enable rewrite module sudo a2enmod rewrite Then restart apache using: sudo service...
// application/controllers/Company_controller.php <?php if(!defined('BASEPATH')) exit('No direct script access allowed'); class Company_controller extends CI_Controller { public function __construct() { parent::__construct(); $this->load->model('companies_mo...
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Cron extends CI_Controller { /** * This is default constructor of the class */ public function __construct() { parent::__construct(); $this->load->library('input'...
In application/hooks folder, create a file with name Blocker.php and paste the below code. <?php class Blocker { function Blocker(){ } /** * This function used to block the every request except allowed ip address */ function requestBlocker(){ ...
To set the timezone in Codeigniter by extending date helper is an alternative way. For doing that need to follow the following two step activity. Extend date helper with the following function: if ( ! function_exists('now')) { /** * Get "now" time * * Returns tim...
Within the CodeIgniter, there are two main directories to worry about: system and application. The system folder contains the core guts of CodeIgniter. The application folder will contain all of the code specific to your application, including models, controllers, views and other relevant libraries...

Page 1 of 1