Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Allow use Codeigniter outside of the MVC structure. directly in file.
PHP
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
application
public
README.md
direct.php

README.md

CodeIgniter Direct v1.0.0

Use Codeigniter 2.1.0 directly in file.

This isn't recommended to ignore CI MVC standards at all but this feature may help You in the specific situations for who like do everything with Codeigniter. For example when You code for devices or non web based apps or backgrounds.

Goals:

  • Use Codeigniter out of framework for specific situations.
  • Do it with minimal change(s) to CI.
  • Keep all CI's features/libraries/helpers/drivers etc.. .

Let's talk about it: http://codeigniter.com/forums/viewthread/217554/.

Install:

  1. Download Codeigniter 2.1.0 from codeigniter.com.
  2. Extract and install Codeigniter to your project directory.
  3. Download Codeigniter-direct https://github.com/Stunt/Codeigniter-direct.
  4. Copy and Replace Codeigniter-direct files in your project.

Usage:

  • Create your files in public/ directory and use $CI object. (like the sample : ./public/test.php)
<?php require_once realpath(dirname(__FILE__).'/../direct.php'); // include bootstrap

// Include direct.php and you have access to CI object and all Codeignite features.

$CI->load->library('user_agent');
echo $CI->agent->browser();

/* End of file ./public/test.php */
?>

I NEVER FULLY TESTED AND CAN'T QUARANTEE THAT USING CI IN THIS MOD DOSN'T MAKE IT BROKE OR HASN'T BAD EFFECT ON THE PERFORMANCE. BUT IN MY CASE(s) I DOSN'T SEE ANY PROBLEM.

Something went wrong with that request. Please try again.