Results 1 to 10 of 47

Thread: Ext.Direct for CodeIgniter

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Ext User
    Join Date
    Apr 2009
    Vote Rating

    Default Ext.Direct for CodeIgniter

    Just copy archive contents to your application folder.
    It will create cache folder in your application folder (make this folder writable!).
    It will place extdapi.php, extdcacheprovider.php, extdrouter.php to the libraries folder.
    It will place example classes Echo.php, Exception.php, File.php, Time.php to the same folder.
    And it will place direct.php to the controllers folder.

    Now you can test it:
    1. Add a script tag in your main application page for the API:
    <script type="text/javascript" src="<?=base_path()?>direct/api"></script>
    2. Add provider:
    3. Now you can call some method, for example Time.get():
    Ext.mits.Time.get(function(provider, response) {
        Ext.Msg.alert('response', response.result);
    Now you can use your own classes:
    Place them to the libraries folder. Don't forget to make comments before each method of your class. First of all it should have @remotable attribute:
    class Time {
         * @remotable
        public function get(){
            return date('m-d-Y H:i:s');
    If you use method to submit form, add @formHandler attribute:
     * @remotable
     * @formHandler
    Just see example classes, included in this implementation.

    To include your own classes replace $api definition in file direct.php with your own:
    Classes files should be named accordingly MyClass1.php, MyClass2.php, ...

    If you want to use CodeIgniter object in your classes, just get instance:
    PHP Code:
    $CI =& get_instance(); 
    P.S. This code doesn't work on Windows platform, because of backslashes in win paths.. something should be updated...
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts