setting.php 461 B

12345678910111213141516171819202122
  1. <?php
  2. /**
  3. *
  4. */
  5. class Setting extends Controller{
  6. function main(){
  7. $data['setting'] = $this->settings_model->lists();
  8. import::view('setting/index',$data);
  9. }
  10. function edit($id){
  11. if(Method::post()){$this->settings_model->update(Method::post());}
  12. $data['edit'] = $this->settings_model->edit($id);
  13. import::view('setting/edit',$data);
  14. }
  15. function delete($id){
  16. DB::where('id', $id)->delete('settings');
  17. redirect(baseUrl().'admin/setting');
  18. }
  19. }