ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Ajax Framework (CJAX) for Codeigniter 2.x+

April 29, 2012 11:33am

Subscribe [24]
  • #106 / Jun 25, 2012 8:18pm

    Ajaxboy

    243 posts

    Hello Frank,


    Appears you are talking about the ajax upload functionality or the uploadify plugin,

    just replace ““$_SERVER[‘DOCUMENT_ROOT’]” for baser_url()./myfolder,  and that should be all…

    make sure “baser_url()” is a local server directory and not a url.

  • #107 / Jun 28, 2012 3:50pm

    Ajaxboy

    243 posts

    @MonsterTKE

    I believe this is the functionality you were after (with better definition):

    Sample:

    http://cjax.sourceforge.net/examples/overlay_validation.php

    This will be fully supported in the upcoming RC3.

  • #108 / Jun 28, 2012 3:53pm

    MonsterTKE

    27 posts

    Cool, This will be very helpful.

  • #109 / Jun 30, 2012 9:48pm

    Ajaxboy

    243 posts

    Version 5.0-RC3 has been released

    This release has been tested with the latest CI 2.1.1 (and 2.1.0), no issues have been found.


    Release Date: Jun/30/2012

    Download
    https://sourceforge.net/projects/cjax/files/CodeIgnater/

    Download Demos for RC3
    https://sourceforge.net/projects/cjax/files/Demos/

    Changes from RC2 to RC3:

    * Fixed some small bugs introduced in RC2

    * Ajax Upload functionality was converted into a stand alone plugin “uploader”
    While within the framework API this functionality fits well, this ajax functionality is constantly
    improved and updated so as a plugin gives more flexiblity to release and update faster.

    * New Plugin Autoload functions
    Gives the autoload ability to plugins. So plugins can auto-execute themselves or run stuff without requiring for $ajax->[pluging]() to be initiated.

    * More optional settings introduced for further flexiblity.

    * Auth hook introduced
    If you require to validate user session or validate any user session validity you may
    use this setting to deny or approve an ajax request.

    * Routing hook introduced
      You may now route ajax request to other sections of your application, for example if your application
      has a built addon or plugin system and you simply want to route ajax to other sections of the application,
      you may route these requests with built-in support.

    * Include hook introduced
    If you need to include dependencies in the ajax framework while in ajax request mode, there is now a section where
    you can reference these.

    * Caching is now supported for page load commands

    * New ‘Overlay and client-side’ validation sample released

    * Replaced the “prevent” functionality to favor callbacks functionality.

    View Full ChangeLog:
    http://cjax.svn.sourceforge.net/viewvc/cjax/CHANGELOG.txt?revision=6&view=markup

    Note:
    You will also need to upgrade ajax plugins you may be using to take advantage of the latest features, the older plugin are deprecated so be sure to get the new ones.

     

     

  • #110 / Jul 01, 2012 2:36am

    somenet

    21 posts

    Please can u demostrate complete configuration cjax and codeigniter with example.I can configure cjax with your docs guide but i can’t get any respose while creating controller
    inside application/controller/filename.
    <?php

    class controller_test extends CI_Controller {

    function test()
    {

    $test_array = array(
    1 => 'test1',
    2 => 'test2',
    3 => 'test3'
    );

    return $test_array;
    }

    ?>
    Thanks for sharing framework.

  • #111 / Jul 01, 2012 3:34am

    Ajaxboy

    243 posts

    Hello… somenet,

    as specified in the CI Wiki.. all ajax controllers in Ajax Fw for CI go in application/response/ ( not application/controllers). There are two distributions of the ajax framework, be sure to follow these instructions:  http://codeigniter.com/wiki/Ajax_Framework_For_CodeIgniter

    so copy in file: application/response/test.php function test, copy that:

    function test()
      {

    $test_array = array(
    1 => ‘test1’,
    2 => ‘test2’,
    3 => ‘test3’
    );

    return $test_array;
    }

    then you will be able to see the response you expect.

    -cj

  • #112 / Jul 02, 2012 4:58am

    Ajaxboy

    243 posts

    Introducing…

    Nightly releases..

    So we will be posting Nightly releases here:
    https://sourceforge.net/projects/cjax/files/Nightly/CodeIgnater/

    Nightly releases/Early releases are releases that have new functionality or features or extended features/enhancements or fixes or simply “new stuff”. This gives a very solid preview of what the next official release is going to be and also gives a chance to test even more for everyone. Nightly releases will not be announced so you just have to keep:  https://sourceforge.net/projects/cjax/files/Nightly/CodeIgnater/ in your favorites. This does not mean that there will be a release every night, but rather provides a preview section whenever is necessary.

    When applicable, there will also be demos nightly packaging:
    https://sourceforge.net/projects/cjax/files/Nightly/Demos/

    Some times the stuff being cooked it is too good to keep out of reach, so this is a chance for anyone looking forward for new Ajax features or functionality enhancements.

    This is also a way to quickly address issues and make the availability of the fixes quicker.

     

     

  • #113 / Jul 02, 2012 9:14am

    rafabkn

    7 posts

    Hi everyone!!

    This is my first time posting and my English is not very good. First of all, thanks for this awesome framework. I’m newbie with CI an CJAX. I’m trying to develop a web application using the following FWs:
    - CodeIgniter 2.1.0
    - DataMapper ORM 1.8.2.1
    - Ocular Template Library
    - AJAXFW_4CI_5.0RC2

    My question is quite simple: Does anyone get DataMapper working over CJAX? Is it possible? I had some issues installing CJAX, which I solved by linking ‘cjax’ folder into ‘system/core’. Moreover I changed ‘ajaxfw.php’ and ‘ajax.php’ as you said in previous posts.

    Right now I can work with CJAX, but I’ve got some problems when using DataMapper into AJAX controllers (in ‘application/response’). You can see one of my controllers in the code below:

    public function save_client()
         {
             $this->load->library('datamapper');
     
             $ajax = ajax();
     
             echo "Error 0";
             $u = new User();
     
             echo "Error 1";
     
             // Recibe los datos del nuevo cliente
             $u->email = $this->input->post('email');
             $u->password = $this->input->post('password');
             $u->name = $this->input->post('name');
             $u->surname = $this->input->post('surname');
             $u->company = $this->input->post('company');
             $u->telephone = $this->input->post('telephone');
             $u->nif = $this->input->post('nif');
             $u->type = 1;
             $u->confidence = 0;
             $u->status = 0;    
     
             echo "Error 2";
    
    ..............

    This function breaks after “Error 0”.

    Thank you very much in advance for your help.

  • #114 / Jul 02, 2012 9:34am

    Ajaxboy

    243 posts

    Hello rafabkn,

    are you including file ‘ajaxfw.php’?

    -cj

  • #115 / Jul 02, 2012 10:00am

    rafabkn

    7 posts

    Hello Ajaxboy,

    Thanks for your soon reply. Yes, I’m including ‘ajaxfw.php’ in my class Construct. This is part of my controller in my Admin Controller (in ‘application/controllers/admin.php’). What’s the difference between write ajax functions in ‘application/response’ and ‘application/controllers’. I’ve readed there is no difference.

    class Admin extends CI_Controller {
     
         /**
          * Constructor
          *
          * @return void
          * @author Rafael Enriquez - Naftic Cloud S.L.
          **/
         public function __construct()   
         {
             parent::__construct();
             $this->load->file(FCPATH.'ajaxfw.php');
             $this->output->enable_profiler(TRUE);
         }
    
    .........................

    Thank you very much

  • #116 / Jul 02, 2012 10:10am

    Ajaxboy

    243 posts

    There is no substantial difference.  Just to be sure,  what is the path of the file in your code above?

  • #117 / Jul 02, 2012 10:15am

    rafabkn

    7 posts

    ‘/var/www/html/test/application/controllers/admin.php’

  • #118 / Jul 02, 2012 10:24am

    Ajaxboy

    243 posts

    What version of PHP are you using?, also since you mentioned you did some changes

    linking ‘cjax’ folder into ‘system/core’.

    I am unfamiliar with this change or fix, so by doing this you might have unintentionally brake it.

    Go ahead and update to RC3, and undo the change mentioned above, then let me know how that goes

  • #119 / Jul 02, 2012 10:48am

    rafabkn

    7 posts

    I’m using PHP 5.3.13.
    I’ve upgraded to RC3 and I’ve done a clean installation. Now I have this folder tree:

    |~application/
    | |+cache/
    | |+config/
    | |+controllers/
    | |+core/
    | |+datamapper/
    | |+errors/
    | |+helpers/
    | |+hooks/
    | |+language/
    | |+libraries/
    | |+logs/
    | |+models/
    | |+response/
    | |+third_party/
    | |+views/
    | `-index.html*
    |+assets/
    |~cjax/
    | |+core/
    | |+plugins/
    | |-auth.default.php*
    | |-cjax.php*
    | |-config.default.php*
    | `-includes.default.php*
    |+system/
    |-ajax.php*
    |-ajaxfw.php*
    |-htaccess.txt*
    `-index.php*

    No links this time.

    I also have modified line 22 of ‘ajax.php’:

    define ('AJAX_CD', 'application/response');

    for this one:

    define ('AJAX_CD', 'application/controllers');

    Still the same problem. I can not use CJAX and DataMapper in same controller.

  • #120 / Jul 02, 2012 11:01am

    Ajaxboy

    243 posts

    Generically speaking it should work, although I haven’t personally use DataMapper, there is nothing in the Ajax Framework that would prevent it from working - that is according to my sight from here.

    Though, lets go ahead and sort this out:

    Try this, do:

    die('ajax:<pre>'.print_r($ajax,1).'<pre>');

    right after:

    $ajax = ajax();

    also try this scenario,
    just for testing purpose:
    removing the DataMapper, and do the same debugging above

    then let me know what you see on both scenarios

     

     

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases