如何修复codeigniter指向网址?

时间:2014-02-09 16:21:15

标签: php 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

1 个答案:

答案 0 :(得分:0)

我想你可以试试这个:

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

上面的代码将输出:

http://localhost/index.php/create