我的控制器中有以下代码:
$data['action']='contact/add';
$this->load->view('inc/header');
$this->load->view('contact',$data);
$this->load->view('inc/footer');
并且当我加载视图页面时,它呈现以下表单元素:
<form
action="http://someurl.com/index.php/Booknow/add.html"
id="registrationform"
class="row" name="registrationform"
method="post"
accept-charset="utf-8">
我什么都找不到的原因是什么?
它已经被记录为here(URL后缀配置),原因是它不在您的控制器,视图或HTML中。
With empty url suffix:
site_url('foo/bar'): http://localhost/ap.programming/foo/bar
base_url('bar/bas'): http://localhost/ap.programming/bar/bas
With '.jsp' as url suffix:
site_url('foo/bar'): http://localhost/ap.programming/foo/bar.jsp
base_url('bar/bas'): http://localhost/ap.programming/bar/bas
P.S:
故意不考虑Codeigniter 4。
注意:在问题中包含PHP视图(未渲染的HTML)和渲染的HTML(对下一个问题的建议)是很好的。