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网站网址和基本网址之间的差异
发布评论