我认为您在应用程序中是“内部”的意思。
您可以创建自己的
<a>标签,并在href中插入这样的网址
<a href="<?php echo site_url('controller/function/uri') ?>">link</a>或者您可以通过这种方式使用URL帮助器来生成
<a>标签
anchor(uri segments, text, attributes)
所以…使用它…
<?php echo anchor('controller/function/uri', 'link', '') ?>那会产生
<a href="http://domain.com/index.php/controller/function/uri" >link</a>
对于其他评论的问题
我会用我的第一个例子
所以…
<a href="<?php echo site_url('controller/function') ?>"><img src="<?php echo base_url() ?>img/path/file.jpg" /></a>对于图像(和其他资产),我不会将文件路径放在php中,我只会回显base_url(),然后正常添加路径。



