Welcome Guest, Not a member yet? Register   Sign In
Issues with Scaffolding
#1

[eluser]edziffel[/eluser]
When running the scaffolding helper from my browser -http://localhost/testcase/index.php/testcase/scaffolding/do_delete/1 I get:
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /var/www/testcase/system/application/controllers/testcase.php:23)

Filename: scaffolding/Scaffolding.php

Line Number: 284

Saffolding starts and works up to the point of posting an entry. Even with the error the record is sent to the database.

I started having problems with scaffolding so to isolate I redid the video tutorial, after I redid a complete install of CI from a fresh download after deleting the entire previous install, up to where the scaffolding is demonstrated, this time named test case. Still having problems. Here is the code from the controller and the view, testcase.php and testcase_view.php respectively.

<?php

class Testcase extends Controller {

function Testcase()
{
parent::Controller();

$this->load->scaffolding('blog');
}

function index()
{
$data['title'] = "My blog title";
$data['heading'] = "My Blog heading";
$data['query'] = $this->db->get('blog');

$this->load->view('testcase_view', $data);
}
}

?>
last line # is 22 (anyone know how to do a screen print to the buffer in Ubuntu? I'm using gvim for an editor)

<html>
<head>
<title><?=$title?></title>
</head>
<body>
<h1>&lt;?=$heading?&gt;</h1>


&lt;?php foreach($query->result() as $row): ?&gt;

<h3>&lt;?=$row->title?&gt;</h3>
<p>&lt;?=$row->body?&gt;</p>

<hr>

&lt;?php endforeach; ?&gt;


&lt;/body&gt;
&lt;/html&gt;
Last line #20

Have checked the config files, but wouldn't rule it out at this time.

Thanks ED
#2

[eluser]edziffel[/eluser]
Just checked the url in the first post line 1. Everything works fine except for the posting/deleting of records.
#3

[eluser]edziffel[/eluser]
Found the issue or at least a cure. Some how got hidden characters into my code. Cleared the buffers deleted swap files, deleted the problem files and redid the controller from scratch. So far so good...

Thanks Ed




Theme © iAndrew 2016 - Forum software by © MyBB