开发者

codeigniter navigation problem

Hi i am using codeigniter 1.7.3. I just implemented pagination in application which works fine.

When i click on next previous buttons it works fine.

But when i click other tabs like Home which invokes HomeController of application. After that application gives error and URL got changes.

http://localhost/myapp/search/pages/4

to

http://localhost/myapp/search/pages/home

this is query is printed on开发者_如何学Go page.

SELECT * FROM my_table WHERE 0=0 AND STATUS='A' ORDER BY CREATION_DATE DESC LIMIT home,2 

This is my process Home Function in HomeController

function processHome(){
        $message =  $this->input->post('message');
        $requestSource = $this->input->post('requestSource');   

        $data['tabId'] = "HOME";
        $data['serverMessage'] = $message;
        $data['includeView'] = "profilesearch";
        $data['showContainer'] ="";

        $this->load->view('index', $data);  
    }

This is java script function which is called on click of Home tab.

<li id="HOME" ><a href="javascript:void(0);" onClick="javascript:processHome();">Home</a></li>    


function processHome(){     
    $('form#containerForm').attr({action: "home/processHome"}); 
    $('form#containerForm').append("<input type='hidden' name='requestSource' value='processHome' />");
    $('form#containerForm').submit();   
}


If possible, use the "anchor" function to create links.

echo anchor('home', 'Home"');

it probably will generate http://localhost/myapp/home

Help about anchor: http://codeigniter.com/user_guide/helpers/url_helper.html


Make sure that your $config['base_url'] variable is configured correctly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜