我是 CodeIgniter 的新手,无法确定路由。当我转到“/SimplePie1”时,出现 404 页面未找到错误。是我的路由问题,还是我弄乱了控制器或视图?谢谢。
我的控制器:
class Feeder extends CI_Controller {
public function index()
{
$this->load->library('rss');
$feed = $this->rss;
$feed->set_feed_url('http://www.theverge.com/rss/frontpage');
$success = $feed->init();
$feed->handle_content_type();
$this->load->view('feed_view', array('feed' => $feed));
}
}
我的观点:
<?php include_once('header.php'); ?>
<?php include_once('navbar.php'); ?>
<?php foreach($feed as $item) : ?>
<br />
<a href="<?php echo $item['permalink']; ?>"><?php echo $item['title']; ?></a>
<?php endforeach; ?>
<?php include_once('footer.php'); ?>
我的路线:
$route['default_controller'] = "homeController";
$route['feed_views'] = "SimplePie1";
$route['404_override'] = '';