Welcome Guest, Not a member yet? Register   Sign In
How to "install" xajax in CodeIgniter??
#1

[eluser]Unknown[/eluser]
hello!!
i have been trying out the xajax library in CodeIgniter and always a got this error
Quote:Fatal error: Call to undefined method xajax::processRequests()
it don't recognize the processRequests() function... i don't know what to dou to fix it...
anyone could help me to use or "instal" tha xajax library in CodeIgniter... i got the full package of xajax 0.5 beta 4... How to "install" xajax in CodeIgniter!!
#2

[eluser]mistress_shiira[/eluser]
the new release of xajax doesnt use the function processRequests
its declared this way already: xajax->processRequest()

hope that helps...
#3

[eluser]Unknown[/eluser]
i know how to declarate the function but it dosn't recognize as a function... in the browser show that message...
#4

[eluser]mistress_shiira[/eluser]
well,try to do this:

1. unzip your codeingniter folder to the directory that you want
2. also unzip the folder containing your xajax files
3. copy xajax_core files and put it in system/application/libraries
then also copy xajax_js and put it somewhere convenient for you( i put it in the top level of my system)
4. in the system/application directory create a folder called init
and within that folder create init_xajax.php

Quote:<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

if ( ! class_exists('xajax'))
{
require_once(APPPATH.'libraries/xajax'.EXT);
}

$obj =& get_instance();
$obj->xajax = new xajax();
$obj->ci_is_loaded[] = 'xajax';

?>
5. to check if its working try this simple exercise:
Quote:<?php

class testxajax extends controller {
function index() {
function test_function($number) {
$objResponse = new xajaxResponse();
$objResponse->assign("hello","value", "Xajax is working. Lets add: ".($number+3));
return $objResponse;
}

$this->load->library('xajax');

$this->xajax->registerFunction("test_function");

$this->xajax->processRequest();

$template['xajax_js'] = $this->xajax->getjavascript('../../');

$template['content'] = '<div id="SomeElementId"></div>&lt;input type="button" value="test" onclick="xajax_test_function(2);"&gt;';

$this->load->view('template', $template);
}
}
?&gt;
Note: the function getJavascript has a parameter which you will point to where your xajax_js folder is located

hope that helps
#5

[eluser]boba[/eluser]
Why there is a following mistake?

I use xajax_0.5_beta_4b_Standard\tests\suite

Notice: Only variables should be assigned by reference in Z:\home.ru\8\xajax_core\xajaxPluginManager.inc.php on line 268

Notice: Only variables should be assigned by reference in Z:\home.ru\8\xajax_core\xajaxPluginManager.inc.php on line 268

Notice: Only variables should be assigned by reference in Z:\home.ru\8\xajax_core\xajaxPluginManager.inc.php on line 268
Output has already been sent to the browser at Z:\home.ru\8\xajax_core\xajaxPluginManager.inc.php:268. Please make sure the command $xajax->processRequest() is placed before this.

php 4.4.4
#6

[eluser]mistress_shiira[/eluser]
have you followed the steps i posted above?
#7

[eluser]boba[/eluser]
[quote author="mistress_shiira" date="1194530931"]have you followed the steps i posted above?[/quote]

Yes, I have.
It works on my dev server with php 4.3, but it doesn't work with php 4.4.4
#8

[eluser]mistress_shiira[/eluser]
im working with php version 5.2.3 and i have not come across the errors that you mentioned above.
#9

[eluser]viet124[/eluser]
I am also getting errors following those directions above:

Quote:A PHP Error was encountered
Severity: Notice
Message: Only variables should be assigned by reference
Filename: libraries/xajaxPluginManager.inc.php
Line Number: 268

A PHP Error was encountered
Severity: Notice
Message: Only variables should be assigned by reference
Filename: libraries/xajaxPluginManager.inc.php
Line Number: 268

Output has already been sent to the browser at /home/eyeam/public_html/dev/system/libraries/Exceptions.php:164. Please make sure the command $xajax->processRequest() is placed before this.

PHP version 4.4.7
xajax version 0.5b4
CI version 1.5.4
#10

[eluser]mistress_shiira[/eluser]
can you post the source code that would get those errors?




Theme © iAndrew 2016 - Forum software by © MyBB