content.php 670 B

12345678910111213141516171819202122232425
  1. <?php
  2. class Content extends Controller{
  3. function main(){
  4. $data['content'] = $this->content_model->content_list();
  5. Import::view('content/content_list', $data);
  6. }
  7. function content_new(){
  8. if(Method::post()){$this->content_model->content_new(Method::post());}
  9. Import::view('content/content_new');
  10. }
  11. function content_edit($id){
  12. if(method::post()){$this->content_model->content_update(method::post());}
  13. $data['edit'] = $this->content_model->content_edit($id);
  14. Import::view('content/content_update',$data);
  15. }
  16. function content_delete($id){
  17. DB::where('id', $id)->delete('content');
  18. redirect(baseUrl().'admin/content');
  19. }
  20. }