更新时间:2023-02-26 13:09:28
只需编辑 config.php .....
Just edit url_suffix
in config.php .....
$config['url_suffix'] = '.html';
使用 site_url()
<!-- No need .html -->
<a href="<?php echo site_url('welcome/register'); ?>">Register</a>
<!-- <a href="http://domain/welcome/register.html">Register</a> -->
或 anchor()
// No need .html
echo anchor('welcome/register', 'Register');
// <a href="http://domain/welcome/register.html">Register</a>
请注意 :不要忘记加载网址助手与 $ this-> load-> helper('url');
。