Using CodeIgniter - nucauldron/Northeastern-Cauldron-Yearbook GitHub Wiki

After researching some of the options for PHP frameworks to use, I decided that CodeIgniter would fit the bill perfectly. Using it is proving to be very simple and elegant. To get more information on it's usage you can take a look at the User Guide.

URI Handling

CodeIgniter handles URIs quite nicely for the site, and it seems to fit our needs very well. Below is the general structure for the website's URLs:

http://www.cauldron.neu.edu/[controller]/[function]/[parameters]

As you can see, the structure bases everything around the controllers handling all the processing. For example, let's navigate through the URI "/first_controller/view/homepage/" to see how it would be handled:

<?php
class First_Controller extends CLI_Controller {
    public function view($page = 'homepage') {
        if (!file_exists("application/views/{$page}.php") {
            show_404();
        }

        $data['title'] = ucfirst($page);
        $this->load->view('header');
        $this->load->view('content', $data);
        $this->load->view('footer');
    }
}
?>

As you can see, the url provided will access the above controller and run the function "view" with the parameter $page = 'homepage'. This is a very strait forward approach that will work wonders for us.