加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – 与CodeIgniter Site Url和base Url的区别

发布时间:2020-12-13 18:07:28 所属栏目:PHP教程 来源:网络整理
导读:您好SiteUrl()和BaseUrl()之间的区别是什么 ? 在我以前的项目中,它是基本URL,但现在在我的新项目中它是Siteurl.为什么会发生这种情况? baseurl()是一个过时的 要清除所有疑虑,您必须阅读CodeIgniter Manual. Please Click Here 基本URL Returns your site
您好SiteUrl()和BaseUrl()之间的区别是什么

在我以前的项目中,它是基本URL,但现在在我的新项目中它是Siteurl.为什么会发生这种情况?
baseurl()是一个过时的
要清除所有疑虑,您必须阅读CodeIgniter Manual. Please Click Here

基本URL

Returns your site base URL,as specified in your config file. Example:
echo base_url();

This function returns the same thing as site_url,without the
index_page or url_suffix being appended.

Also like site_url,you can supply segments as a string or an array.
Here is a string example: echo base_url(“blog/post/123”);

网站网址

Returns your site URL,as specified in your config file. The index.php
file (or whatever you have set as your site index_page in your config
file) will be added to the URL,as will any URI segments you pass to
the function,and the url_suffix as set in your config file.

You are encouraged to use this function any time you need to generate
a local URL so that your pages become more portable in the event your
URL changes.

Segments can be optionally passed to the function as a string or an
array. Here is a string example: echo site_url(“news/local/123”);

The above example would return something like:
07001

Here is an example of segments passed as an array: $segments =
array(‘news’,‘local’,‘123’);

echo site_url($segments);

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读