Welcome Guest, Not a member yet? Register   Sign In
One Scaffolding to rule them all
#1

[eluser]Michael Ekoka[/eluser]
Since the aim of Scaffolding is to quickly access tables in the db, I find it simpler to have one controller solely used for that purpose.
I use something like this:
Code:
class Scaffold_controller extends Controller{
    public function __construct(){
        session_start();
        parent::Controller();
        if($this->uri->segment(4)=='switch'){
            $_SESSION[APPPATH]['table_to_scaffold']= $this->uri->segment(3);
        }
        $this->load->scaffolding(@$_SESSION[APPPATH]['table_to_scaffold']);
    }
}

Then to scaffold a table, in my url I can simply enter the name of the table and authorize the switch:
http://localhost/myapp/scaffold_controll...ble/switch

in reality it would look more like this :
http://localhost/blog/scaffold/go/entries/switch

As have been said by wiser men than me, use scaffold with lots of caution and in dev only.


Messages In This Thread
One Scaffolding to rule them all - by El Forum - 07-01-2007, 11:36 AM
One Scaffolding to rule them all - by El Forum - 07-01-2007, 08:07 PM
One Scaffolding to rule them all - by El Forum - 07-01-2007, 09:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB