[eluser]mmmx[/eluser]
Strict Standards issues: a lot!!!
Hello
i need some help
I shall try ajaxfw but can't get it work
I'm using:
[PHP: 5.3.8]
ci 2.1.2 clean installation
After installing test page is ok, but when i click on test2 link i get:
Code: Invalid Function: ajax.php
I didn't mind and tried with examples: I got a lot of Stric Standard message and nothing works.
Please, tell me where i do wrong.
Here is for example examples/bind_elements.php result:
Code: Strict Standards: Declaration of CJAX_FRAMEWORK::dialog() should be compatible with that of cjaxFormat::dialog() in C:\xampp\htdocs\ci212\cjax\core\classes\cjax.class.php on line 26
Strict Standards: Non-static method plugin::initiatePlugins() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 613
Strict Standards: Non-static method plugin::isPlugin() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 589
Strict Standards: Creating default object from empty value in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 247
Strict Standards: Non-static method CoreEvents::removeExecCache() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\ci212\cjax\core\classes\xmlItem.class.php on line 86
Strict Standards: Non-static method CoreEvents::simpleCommit() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 1222
Strict Standards: Non-static method CoreEvents::processScache() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 422
Strict Standards: Non-static method CoreEvents::mkArray() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 551
Strict Standards: Non-static method CoreEvents::encode() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 746
Strict Standards: Non-static method CoreEvents::mkArray() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 424
Strict Standards: Non-static method CoreEvents::encode() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 746
Strict Standards: Non-static method CoreEvents::save() should not be called statically, assuming $this from incompatible context in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 434
Bind elements into same commands
Basically both anchor are hooked by the same event used
Click Me (element 1)
Click Me (element 2)
Code used:
<?php
$ajax->Exec("link1|link2",$ajax->call("ajax.php?bind/bild_elements"));
?>
Strict Standards: Non-static method CoreEvents::isAjaxRequest() should not be called statically in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 457
Strict Standards: Non-static method CoreEvents::input() should not be called statically in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 1035
Strict Standards: Non-static method CoreEvents::input() should not be called statically in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 1039
Strict Standards: Non-static method CoreEvents::commit() should not be called statically in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 464
Strict Standards: Non-static method CoreEvents::processScache() should not be called statically in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 373
Strict Standards: Non-static method CoreEvents::mkArray() should not be called statically in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 551
Strict Standards: Non-static method CoreEvents::encode() should not be called statically in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 746
Strict Standards: Non-static method CoreEvents::_processScacheAddEventTo() should not be called statically in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 542
Strict Standards: Non-static method CoreEvents::xmlIt() should not be called statically in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 523
Strict Standards: Non-static method CoreEvents::mkArray() should not be called statically in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 533
Strict Standards: Non-static method CoreEvents::encode() should not be called statically in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 746
Strict Standards: Non-static method CoreEvents::mkArray() should not be called statically in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 375
Strict Standards: Non-static method CoreEvents::encode() should not be called statically in C:\xampp\htdocs\ci212\cjax\core\classes\core.class.php on line 746
thanks for attention
[eluser]Ajaxboy[/eluser]
Sounds like your php installation is in strict mode.
Try:
Code: error_reporting(E_ALL ^ E_STRICT);
[eluser]mmmx[/eluser]
already tried it, both in ajax.php, in the example file bind_element.php and tried to put ci in production mode.
nothing changed.
other ideas?
[eluser]Ajaxboy[/eluser]
try in your php.ini file.
Code: error_reporting = E_ALL ^ E_STRICT
[eluser]mmmx[/eluser]
[quote author="Ajaxboy" date="1346275038"]try in your php.ini file. [/quote]
thanks a lot
that worked
[eluser]lostsword[/eluser]
HI,
i have a regular codeigniter controller which have the following code:
Code: class Person extends CI_Controller
{
require_once(FCPATH.'ajaxfw.php');
public function index()
{
$ajax = ajax();
$ajax->success('Person', 0);
$this->load->view('person');
}
}
this is the person view
Code: <!DOCTYPE html>
<html lang="en">
<head>
[removed][removed]
<!-- here i am including the js file of cjax ( cjax-5.0-Stable.min.js ) !-->
</head>
<body>
</body>
</html>
when i load the controller www.domain.com/person it gives me the success message and every thing is ok
the problem is that the success message which says "Person" appear in all other views and controllers although it is called only in the person controller
by the way i am including the cjax js on all views
the firebug shows this as the response :
Code: CJAX.process_all("<json>{"0":"<cjax><do>_message<\/do><message><div+class='cjax_message+cjax_message_type+cjax_success'>Person<\/div>\n<\/message><time>3<\/time><message_id>cjax_message<\/message_id><uniqid>0<\/uniqid><\/cjax>"}</json>","", 0, true);
any solutions ?
[eluser]lostsword[/eluser]
another example:
theses are another functions in the same controller Person above
Code: public function person1()
{
$ajax = ajax();
$ajax->success('Person1', 0);
$data['cjax_js_url'] = $ajax->init('http://www.domain.com/');
$this->load->view('person',$data);
}
public function person2()
{
$ajax = ajax();
$ajax->success('Person2', 0);
$data['cjax_js_url'] = $ajax->init('http://www.domain.com/');
$this->load->view('person',$data);
}
public function person3()
{
$this->load->view('person');
}
public function person4()
{
$ajax = ajax();
$data['cjax_js_url'] = $ajax->init('http://www.domain.com/');
$this->load->view('person',$data);
}
in the view i am printing $cjax_js_url in the header
the outputs of the three methods when called in order are as follow:
www.domain.com/person/person1 ---> person1
www.domain.com/person/person2 ---> person2
www.domain.com/person/person3 --->
www.domain.com/person/person4 ---> person2
why person4 is showing a message ??
[eluser]Ajaxboy[/eluser]
In your first post there appears to be a syntax error, the require file is being invoked from outside the function and after the class creation, this is invalid and will probably cause an error.
use it like this instead:
Code: class Person extends CI_Controller
{
public function index()
{
require_once(FCPATH.'ajaxfw.php');
$ajax = ajax();
$ajax->success('Person', 0);
$this->load->view('person');
}
}
[eluser]Ajaxboy[/eluser]
Validate & Uploader Plugin Integration
The integration of the validate plugin and the uploader is coming soon in the 5.1, this integration allows you to use both plugins with a single API, while allowing you full functionality of both plugins!.
See demo:
http://cjax.sourceforge.net/examples/val...loader.php
Small code sample:
Code: //where null you can put a "pre" submit url, where the form will be submitted before files are uploaded, part of the validate plugin.
//the uploader offers "post" submit url, which is submitted after the files are uploaded, so you are covered on all fronts.
$ajax->validate('button_id', null, $rules)->uploader(
array(
'target' => 'upload/directory/',
'text'=> 'Submitting Form..',
'url' => 'ajax.php?validation_uploader/post',
'success_message' => 'Form submitted successfully.',
'form_id' => 'form1',
'suffix' => time()
)
);
In other notes,
Nearly zero bugs have been found on 5.0 or very small insignificant bugs. Though some improvements are coming in 5.1 including support for PHP 5.2!!!!!
[eluser]jupiter1031[/eluser]
I have an implementation question for cjax
I have a form where the user enters a promo code. I look up the promo code in my database table. If it is correct a success message is displayed the code will be used. If it is not correct the form does not allow a submit unless the user clears the promo field or enters the correct code.
This is my first time I am using cjax and I am not sure what cjax commands to use in my view and in my controller. I understand it is a form validation but I have not found an example for codeigniter that I can understand.
I have looked at the samples but I still don't understand the principles of the cjax method especially for CI.
(I have used xajax before but I want to go away from it because it seems to be an unsupported dead end)
Thank you for helping me to get started!
|