2014-02-09 43 views
0

我有一段代碼如何修復codeigniter指導url?

$data = array(
      'class'=>"btn btn-primary btn-lg", 
      'id' => "btnSearch", 
      'role'=> "button", 
      ); 

echo anchor("create",'<span class="glyphicon glyphicon-search"></span>Search',$data); 

當我按一下按鈕,它引導我

http://localhost/xxxx/URL/index.php/create 

,但我希望它只是

http://localhost/xxxx/index.php/create 

回答

0

我想你可以試試這個:

echo $this->base_url().'create'; 

以上代碼將輸出:

http://localhost/index.php/create