<?php
class Page extends CI_Controller{
function index(){
$this->view('home');
}
public function view($page = 'home')
{
if ( ! file_exists('application/views/pages/'.$page.'.php'))
{
// Whoops, we don't have a page for that!
show_404();
}
$data['title'] = ucfirst($page); // Capitalize the first letter
$this->load->view('templates/header', $data);
$this->load->view('pages/'.$page, $data);
$this->load->view('templates/footer', $data);
}
我想查看带有http://www.mydomain.com/page/about、http://www.mydomain.com/page/services等链接的页面,而不是http://www.mydomain.com/ 格式page/view/about和http://www.mydomain.com/page/view/services
我该怎么做?