Php 在codeigniter中查看静态页面
我想查看的网页与链接等不是在格式和格式Php 在codeigniter中查看静态页面,php,codeigniter,Php,Codeigniter,我想查看的网页与链接等不是在格式和格式 如何执行此操作?在/config/route.php中为特定的静态页面设置路由 <?php class Page extends CI_Controller{ function index(){ $this->view('home'); } public function view($page = 'home') { if ( ! file_exists('applicati
如何执行此操作?在/config/route.php中为特定的静态页面设置路由
<?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);
}
在/config/route.php中为特定的静态页面设置路由
<?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);
}
在config/routes.php中,可以添加路由:
$route['contact'] = 'site/page/contact';
在config/routes.php中,可以添加路由:
$route['contact'] = 'site/page/contact';
请帮我检查我的问题请帮我检查我的问题