【发布时间】:2015-06-03 08:45:34
【问题描述】:
我在应用程序/控制器中有 2 个控制器
- Welcome.php
- pages.php
我正在通过这个 url 访问welcome.php
http://opunletter.com/index.php/welcome/
但是在访问http://opunletter.com/index.php/pages/时
我收到以下错误
404 页面未找到
未找到您请求的页面。
我无法找出错误。请帮忙!
class Pages extends Controller {
function search($search_terms = '')
{
// If the form has been submitted, rewrite the URL so that the search
// terms can be passed as a parameter to the action. Note that there
// are some issues with certain characters here.
if ($this->input->post('q'))
{
redirect('/pages/search/' . $this->input->post('q'));
}
if ($search_terms)
{
// Load the model and perform the search
$this->load->model('page_model');
$results = $this->page_model->search($search_terms);
}
// Render the view, passing it the necessary data
$this->load->view('search_results', array(
'search_terms' => $search_terms,
'results' => @$results
));
}
}
【问题讨论】:
-
你能告诉我们你的页面控制器代码吗?
标签: php codeigniter