public function before() { parent::before(); $this->curr_db = $this->request->param('database', 'default'); $model = new Model($this->curr_db); $tables = $model->list_tables()->as_array(); $tables = array_map('array_pop', $tables); $this->curr_table = $this->request->param('table'); View::bind_global('tables', $tables); View::bind_global('curr_db', $this->curr_db); View::bind_global('curr_table', $this->curr_table); View::bind_global('action', $this->request->action); View::bind_global('content', $this->content); }