Welcome Guest, Not a member yet? Register   Sign In
Scaffolding Problems - Code seems to be ignored.
#1

[eluser]JeffreyRopp[/eluser]
For some reason I can't get scaffolding to work. The code seems to be ignored altogether as other statements (e.g., echo) are executed as expected in the constructor. The same behavior occurs in other functions.

At first I thought it was a problem I read about in a discussion about subdirectories. I've since moved my code to the root and have the same problem.

I've done everything exactly as described in the demo and have no trouble accessing the data using the framework code. I've also ruled out any database security issues.

Here's my constructor:
Code:
function Band()
    {
        parent::Controller();
         $this->load->scaffolding('bands');
    }

Here's my routes.php:
Code:
$route['default_controller'] = "band";
$route['scaffolding_trigger'] = "scaffolding";

Here's my config.php:
Code:
$config['base_url']    = "http://localhost/";
$config['index_page'] = "index.php?";

Here's my autoload.php:
Code:
$autoload['libraries'] = array('database');   **note this is different in the tutorial**

Any thoughts? Thanks very much for any help!
Jeff
#2

[eluser]Michael Wales[/eluser]
hmm... first of all this:
Code:
function Band()
    {
        parent::Controller();
         $this->load->scaffolding('bands');
    }

Should be:
Code:
function Band() {
  parent::Controller();
}

function index() {
  $this->load->scaffolding('bands');
}

The constructor is just used for initial setup sort of work, prior to heading off to your methods (which would then load views).

Finally, make sure your URL includes your scaffolding trigger:
Quote:http://www.domain.com/index.php/band/scaffolding
#3

[eluser]JeffreyRopp[/eluser]
Thanks Power User. I just followed the code from the tutorial initially. I've also tried the code in the index function as you suggested - same results. I do have the URL as you suggested. Any other ideas?
#4

[eluser]ELRafael[/eluser]
The table bands exists? You can access it, normally? Just to check :-P

What Power user (why you cange your name Michael? The old one is better) told is correct, should worked.

All the other things in CI are working?
#5

[eluser]JeffreyRopp[/eluser]
Thanks Rafael,
Yes...I'm sure everything was fine on the database side. I was able to retrieve records using CI.

I finally gave up and started from scratch. Now its working. I suspect that some of my GoDaddy configurations created problems when working in a local environment.
#6

[eluser]Michael Wales[/eluser]
Quote:What Power user (why you cange your name Michael? The old one is better) told is correct, should worked.

I changed it for a few reasons:
1) A lot of people thought I was a doctor (walesmd) - it happens to just be my middle initials. It's fun for awhile, but "ehhh... what's up doc?" can get old very quickly.

2) A lot of clients of mine are referred to these forums or from these forums by other people. I like the thought of my actual name being applied to this account rather than an alias.




Theme © iAndrew 2016 - Forum software by © MyBB