After giving up on learning MVC from a book about PHP I decided to learn/use CodeIgniter.
Sources of Information
It’s better to start learning CI by reading its User Guide (instead of a book) since its examples will actually work—because they were written for the installed version of CI.
Here is a link to the User Guide for the current version (was Version 2.1.0 the 1st time I wrote this post—but this link will point to the current online UG) of CI: CodeIgniter Users Guide. There is a local copy—which is part of the install at:
If I upgrade CI this URL may or may not change.
I un-zipped this file into my Mac’s
Sites directory. This
Sites directory is the web-root for my Apache. The correlating URL for the latter is:
Since the CI application has its
index.php at the top directory of the install—and, since I didn’t strip away the top directory—the URL for my installation is:
index.php for the main CI app is here the rest of the code for my application (the code I create and modify) goes in directories two levels lower. The code will be in files found in sub-directories of
I made a change in the file
I specified the base URL as follows:
$config['base_url'] = 'http://sameh-labibs-imac.local/CodeIgniter_2.1.0/';
Also, the manual says:
If you intend to use encryption or sessions, set your encryption key.
I intend to use sessions—and possibly encryption; However, I’ll wait on setting the encryption key.
Also, the manual says:
If you intend to use a database, open the application/config/database.php file with a text editor and set your database settings.
So, I took care of this using the database settings which I have documented elsewhere. However, I wasn’t sure about two of the settings. Here is how I filled the latter out:
$db['default']['database'] = 'samehrlabib_aTestMyLAMP'; $db['default']['dbprefix'] = '';
Maybe I should of had them as:
$db['default']['database'] = 'aTestMyLAMP'; $db['default']['dbprefix'] = 'samehrlabib_';
Either way I don’t think it makes a difference in my current situation.
When I load the CI app URL I see a welcome page which tells me the page is being generated dynamically by CodeIgniter; and, if I would like to edit this page I’ll do that at:
or, the corresponding controller at: