在codeigniter-PHP中查找post的正确url

在codeigniter-PHP中查找post的正确url,php,codeigniter,Php,Codeigniter,在我的controllers/automation.php文件中,我有: class Automation extends CI_Controller { // some code here public function search() { // implementation of the search function } } 现在,在我的library.js文件中,我有: function search() { v

在我的
controllers/automation.php
文件中,我有:

class Automation extends CI_Controller {
       // some code here
       public function search() {
           // implementation of the search function
       }
}
现在,在我的
library.js
文件中,我有:

function search()
{
    var date = $("#datepicker").val();
    $.post('./automation/search', { date : date.toString() },
        function(answer){
            alert(answer);
        }
      );
    return;
}
但是,firebug显示:

POST http://localhost/ci/automation/search 404 Not Found

那么正确的
url是什么?

试试
http://localhost/ci/index.php?automation/search
。如果您没有使用.htaccess修改路径,因此不需要index.php,那么这将是默认设置


如果是这样的话,并且你想在你的路径中去掉index.php,谷歌会给你大量的资源。一个例子是。

几乎,但不完全。。。现在它没有从控制器返回任何信息。。。