• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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_controller/scaffold_trigger/my_db_table/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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.