Welcome Guest, Not a member yet? Register   Sign In
How to set up Xajax correctly in Codeigniter ?
#1

[eluser]ludo31[/eluser]
Hello ;
I would like to test Xajax in codeigniter and I see that !!


help Xajax

first when I download xajax.zip the last version there are a lot of folder and may be we need
xajax_core and xajax_js

so at the first , I try to proceed like as tutorial :
I copy xajax_core folder in application -> libraries
after I create js folder and make xajax_js under so : js /xajax_js

I don't proceed the 6th step about mod_rewrite because this is optional :

so when I test this code :


Code:
<?php
        

class Testxajax extends CI_Controller
{

    public function __construct()
    {
        parent::__construct();
       $this->load->library('xajax');
        $this->xajax->registerFunction(array('test_function',&$this,'test_function'));
        $this->xajax->processRequest();
    }

    
     public function test_function($number)     {
        
         $objResponse=new xajaxResponse();
         $objResponse->assign("someElementId", "innerHTML", "Xajax is working.letts add".($number+3));
         return $objResponse;
     }

    public function index()
    {
        $template['xajax_js']= $this->xajax->getJavascript(null,'js/xajax.js');
        $template['content']='<div id="someElementId"></div>&lt;input type="button" value="test"&gt;';
        $this->load->view('template/index',$template);
        
    }


    
}

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
?&gt;

the xajax.js is xajax.core in js folder and an copy that in js folder in my project
so when I test it i have a message like this :


Quote:An Error Was Encountered

Unable to load the requested class: xajax

so when I see this message I try another method :

I copy xajax.inc of xajax.core and rename it xajax.php and make that in system->libraries

but when I try mabe it can load the librarie xajax but another error appears :

Quote:A PHP Error was encountered

Severity: 8192

Message: Assigning the return value of new by reference is deprecated

Filename: libraries/xajax.php

Line Number: 360
A PHP Error was encountered

Severity: 8192

Message: Assigning the return value of new by reference is deprecated

Filename: libraries/xajax.php

Line Number: 1305
A PHP Error was encountered

Severity: Warning

Message: require(C:\wamp\www\CodeIgniteLien\system\libraries/xajaxPluginManager.inc.php) [function.require]: failed to open stream: No such file or directory

Filename: libraries/xajax.php

Line Number: 257

( ! ) Fatal error: require() [function.require]: Failed opening required 'C:\wamp\www\CodeIgniteLien\system\libraries/xajaxPluginManager.inc.php' (include_path='.;C:\\php\\pear') in C:\wamp\www\CodeIgniteLien\system\libraries\xajax.php on line 257

did you have an idea ???

and another question : when I dowload xajax what are the files that we must copy and must use because there are a lot of files !!

thanks
#2

[eluser]InsiteFX[/eluser]
I emailed you the files along with the Xajax Pagination, hope it helps.
#3

[eluser]ludo31[/eluser]
Thanks a lot InsiteFX ; I 'll see that Wink
#4

[eluser]jupiter1031[/eluser]
I am trying too to install Xajax. Where I am stuck is with the new version if XAJAX the function getJavascript does not accept parameters. When I run my test application I get an error message Error: the javascript component could not be included. I have xajax_js in the root but I need to prefix with base_url() to complete the path to xajax_js.


Could you send me a working sample as well please and what version of xajax are you using?
Thanks a lot!
#5

[eluser]ludo31[/eluser]
hello;
can you send me your email adress and I send you the folder that I have received

I test the last version !!
#6

[eluser]InsiteFX[/eluser]
It's the newest Xajax 0.6 beta1 CI 2.0.+
NOTE: Some of the methods were written by IgnitedCoder and myself. The Xajax is in its own folder under libraries and modified to work with CodeIgniter.

Download:
Xajax test application for Xajax 0.6 beta 1, includes CI Xajax pagination with sample and a login form to show how to use Xajax. There are multiple wait spinners in the assets directory. It's just a quick app I through together for creating the new Xajax pagination but it works.

apptesting.zip
#7

[eluser]jupiter1031[/eluser]
Thank you very much for the zipfile. I will test it right away!
#8

[eluser]jupiter1031[/eluser]
I have been working on a test version for XAJAX but something is wrong I can't figure out. Does any one of you have suggestions how to continue?

Below is the link to my forum post:

http://ellislab.com/forums/viewthread/215523/




Theme © iAndrew 2016 - Forum software by © MyBB