CodeIgniter网站网址和基本网址之间的差异

编程入门 行业动态 更新时间:2024-10-13 14:27:05
本文介绍了CodeIgniter网站网址和基本网址之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Hello SiteUrl()和BaseUrl()之间有什么区别? 在我以前的项目是基地url,但现在在我的新项目是Siteurl。为什么会这样? 是baseurl()是一个过时的

Hello What is the difference between SiteUrl() and BaseUrl() ? In my previous project it is base url but now in my new project it is Siteurl.Why this happens? Is baseurl() is an outdated one

推荐答案

清除所有你的疑问你必须阅读CodeIgniter手册。 a href =ellislab/codeigniter%20/user-guide/helpers/url_helper.html =nofollow>请按此

To clear all your doubts you have to read CodeIgniter Manual.Please Click Here

基本网址

base URL

在你的配置文件。示例: echo base_url();

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

此函数返回与site_url相同的内容,而不附加 index_page或url_suffix。

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

也像site_url一样,您可以以字符串或数组形式提供段。 下面是一个字符串示例:echo base_url(blog / post / 123);

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");

>网站网址

site URL

返回您的配置文件中指定的网站网址。 index.php 文件(或者您在config 文件中设置为您的网站index_page的任何内容)都将添加到URL中,将任何URI段传递给函数,以及您的配置文件中设置的url_suffix。

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.

您可以随时使用此函数生成a本地网址,在您的网址更改的情况下可移植。

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.

段可以选择作为字符串或数组传递到函数。这里是一个字符串示例:echo site_url(news / local / 123);

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");

上面的例子将返回如下: example/index.php/news/local/123

The above example would return something like: example/index.php/news/local/123

下面是作为数组传递的段的示例:$ segments = array('news','local','123');

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

echo site_url($ segments);

echo site_url($segments);

更多推荐

CodeIgniter网站网址和基本网址之间的差异

本文发布于:2023-10-31 13:30:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546228.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:网址   差异   网站   CodeIgniter

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!