Jumat, 04 Mei 2012

Ajax Framework For CodeIgniter

. Jumat, 04 Mei 2012 .

A very basic but powerful implementation of Ajax Framework that complements Codeigniter.

Download here:

Download From Google Code
Cjax Framework separates your ajax controllers from your regular controllers. While your normal controllers reside in application/controllers, your ajax controllers will reside in application/response.

Install

Download and unzip the Ajax Framework package, then just overwrite everything from the zip into your CodeIgniter base installation (will not replace any of your files)

Test

just go to:
http://yoursite.com/ajax.php?controller=test&function=test
(replace http://yoursite.com with the base directory where your CodeIgniter installation resides)
To this point you are done, successfully installing and using Cjax, if the test above prints “Ajax View..”. You can find this text inside file application/views/test.php, and its controller in application/response/test.php.

Friendly URLS

Full support for friendly URLS.
Friendly URLS are supported, but not required to use Cjax.
You may access your controllers in any of the following ways; these examples make use of controller file application/response/test.php.
//ajax.php?controller=$controller&function;=$functionajax.php?controller=test&function=test//ajax.php?$controller/$functionajax.php?test/test//ajax/$controller/$function
#This one requires mod_rewrite
ajax/test/test 
The last url above, will require you to enable mod_rewrite in your server and rename the accompanied file htaccess.txt File:htaccess.txt to .htacccess

Creating Controllers

Creating controllers works the same way as your regular controllers,  except the class name of ajax controller start with the keyword “controller_”. For example, if you want to create a controller named test,  then your class name would be “controller_test”.

Example

application/response/test.php
class controller_test extends CI_Controller {

    
function test()
    
{

    }

 
 

0 komentar:

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Poskan Komentar

 
{nama-blog-anda} is proudly powered by Blogger.com | Template by Agus Ramadhani | o-om.com