Although you're probably going to be writing and reading data in a database you will certainly come in contact with the requirement to write something to the disk, and read from files stored on it. CodeIgniter can support several methods for interacting with files.
There are no configuration options to change here, but ensure that you load the file helper in your controller constructor (and also the url
helper):
function __construct() { parent::__construct(); $this->load->helper('url'); $this->load->helper('file'); }
We're going to read files from the disk and display details about them to a view. Firstly, we're going to create two files:
/path/to/codeigniter/application/controllers/file.php
/path/to/codeigniter/application/views/file/view_file.php
Add the following code into
/path/to/codeigniter/application/controllers/file.php
:<?php if (!defined('BASEPATH')) exit('No direct script...