A PHP Error was encountered Severity: Warning
消息:不能修改标题信息 - 已经发送的标题
(输出开始于
/home/jshultz/public_html/application/cache/routes.php:3)
文件名:core / Security.php
行号:188
遇到PHP错误严重性:警告
消息:不能修改标题信息 - 已经发送的标题
(输出开始于
/home/jshultz/public_html/application/cache/routes.php:3)
文件名:库/ Session.php
行号:672
BLOCKQUOTE>
我想也许这是一个权限错误,但我不知道?我试着改变文件的权限,但没有改变任何东西。有任何想法吗?
编辑:
好的,所以应用程序/缓存文件夹中的routes.php需要打开
以下是在缓存文件夹中创建routes.php文件的CORRECTED代码:
public function save_routes()
{
// this simply returns all the pages from my database
$routes = $this->Pages_model->get_all($this->siteid);
// write out the PHP array to the file with help from the file helper
if ( !empty( $routes ) )
{
// for every page in the database, get the route using the recursive function - _get_route()
foreach( $routes->result_array() as $route )
{
$data[] = '$route["' . $this->_get_route($route['pageid']) . '"] = "' . "pages/index/{$route['pageid']}" . '";';
}
$output = "<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');\n";
$output .= implode("\n", $data);
$this->load->helper('file');
write_file(APPPATH . "cache/routes.php", $output);
}