CI静态化页面

	/**
	 * 静态化文件
	 */
	public function staticFile()
	{
		/*
		$string = $this->output->get_output();
		$string = "abcd";
		$this->load->helper('file');
		write_file('./lianglong_codeigniter.html', $string);
		*/

		$this->load->helper('file');
		$content = $this->load->view('index_lanmu', '', TRUE);
		if ( !write_file('./staticfile.php', $content))
		{
			echo 'Unable to write the file';
		}
		else
		{
			echo 'File written!';
		}
	}

	public function viewStaticIndex(){
		$this->load->view('staticfile');
	}

你可能感兴趣的:(ci框架)