0

我有一个表,它将服务器上文件的文件 ID 存储在视图文件夹中>它用于一个项目,我允许用户上传 html 文件并查看用户上传的内容。我想使用单个控制器功能加载所有文件这就是我正在做的事情..

           public function site_pages()
          {
                 $this->load->model('model_site');
                 // a function which returns the name and file_ids in the database
                 $rows=$this->model_site->get_temp_sites();
                foreach ($rows as $r) 
                {$file_id=$rows->file_id;
                 $r->file_name=$this->uri->segment(3);  
                 $this->load->view('includes/header');
             $this->load->view('site_pages/'.$file_id,$user_data);
                 $this->load->view('includes/footer');
                 }

      }

然而,这显示了两个相互嵌套的网页......我怎样才能克服这个问题以及使用单个控制器加载所有文件?

4

1 回答 1

0

This is one of the cases where an iframe may actually be a good idea. Your enclosing page can simply provide an iframe pointed at the URL for the HTML content page to be viewed.

I think the iframe makes sense here in that, I assume, you are trying to provide an unaltered view of the HTML content (i.e. not use enclosing page's CSS rules, javascript, etc.).

于 2013-04-04T15:44:54.607 回答