Welcome Guest, Not a member yet? Register   Sign In
scaffolding do you have to call load->scaffolding in the class constructor?
#1

[eluser]jared4444[/eluser]
I realize that scaffolding is depricated, but I would still like to play with it.

I can get it to work if I create a class called Db, and call load->scaffolding in the constructor.

I would like to be able to call it from a sub function so I can have one function call for each table. My keyword is scaffolding, and I got the code from the tutorial video #2.

This works:
class Db extends Controller
{
function Db()
{
parent::Controller();
$this->load->scaffolding('size');
}
}

I would like to do this though:
class Db extends Controller
{
function size()
{
parent::Controller();
$this->load->scaffolding('size');
}
function item()
{
parent::Controller();
$this->load->scaffolding('item');
}
}

I have tried having a constructor which calls parent::Controller(), then calling each load in the functions, but that did not work.

It could also be the url I am using, not entirely sure.

This works with the first example and the constructor:
http://localhost/pcw2/index.php/db/scaffolding

I have tried both of these with the bottom example, and it does not work:
http://localhost/pcw2/index.php/db/scaffolding/size - 404 as I expected
http://localhost/pcw2/index.php/db/size/scaffolding - blank page


Messages In This Thread
scaffolding do you have to call load->scaffolding in the class constructor? - by El Forum - 06-14-2009, 12:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB