Codeigniter 2.1.3 と codeigniter の最新の cjax でこの奇妙なエラーが発生しています。奇妙なことに、最新の codeigniter と codeitniger の最新の cjax フレームワークをダウンロードして、友人のサーバーにコピーし、次のように呼び出します。
domain.com/ajax.php?test/test2
テスト ajax の例を表示するには ... 簡単に動作しますが、サーバーでこれを実行すると、サーバー エラーが発生します (どちらも同じ php バージョンなどを使用しています)。次に、サーバーはエラー ログ ファイルに次のエラーをスローします。
PHP Fatal error: Class 'CI_Controller' not found in /hosting/www/domain.com/www/application/response/test.php on line 3
今、私はこの問題を抱えている人々とスタックオーバーフローを読み、コンストラクトを変更してControllerの代わりにCI_Controllerを呼び出すことで解決しました。しかし、私はすでにそれを行っています... - コードに触れずに動作すると思われる基本的な例にあることを意味します。
codeingterの cjax フレームワークの Ajax.php は、test という名前のフォルダー response からコントローラーをロードし、次のような関数 test2 を呼び出す必要があります (test.php という名前の実際のファイル)。
class Test extends CI_Controller {
function __construct()
{
parent::__construct();
}
/**
*
* ajax.php?test/test/a/b/c
*
* @param unknown_type $a
* @param unknown_type $b
* @param unknown_type $c
*/
function test($a = null,$b = null, $c = null)
{
$this->load->view('test', array('data' => $a .' '.$b.' '.$c));
}
/**
* ajax.php?test/test2
*
* Here we are testing out the javascript library.
*
* Note: the library it is not meant to be included in ajax controllers - but in front-controllers,
* it is being used here for the sake of simplicity in testing.
*/
function test2()
{
$ajax = ajax();
$ajax->update('response','Cjax Works');
$ajax->append('#response','<br /><br />version: '.$ajax->version);
$ajax->success('Cjax was successfully installed.', 5);
//see application/views/test2.php
$this->load->view('test2');
}
私は誰かがこの問題に光を当ててくれることを望んでいました - それとも誰かがすでにそれを経験したのでしょうか?
御時間ありがとうございます! マート