[eluser]jshultz[/eluser]
Here's the solution. First, routes.php in the application/cache folder needs to have <?php at the beginning. Since the controller that writes the file writes a whole new file each time I needed to update that controller to the following:
Code:
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);
}