CodeIgniter Forums
Split large page in more view - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10)
+--- Thread: Split large page in more view (/showthread.php?tid=74064)



Split large page in more view - pippuccio76 - 07-18-2019

HI sorry for english , i have a page with 4000 row , because i can find error simply , i want split the page in several view 

can i do this in controller as this :

Code:
     $this->load->view('page/page1', $data);
     $this->load->view('page/page2', $data);
      ecc.

where page1 or page2 are apart of code...


RE: Split large page in more view - Wouter60 - 07-18-2019

Use CodeIgniter's pagination library: https://www.codeigniter.com/user_guide/libraries/pagination.html
Another option is: use Datatables (javascript): https://datatables.net/


RE: Split large page in more view - pippuccio76 - 07-18-2019

I haven't a table , i have a page with several row of code...


RE: Split large page in more view - Wouter60 - 07-18-2019

In that case, what you suggested is possible indeed:
PHP Code:
$this->load->view('page/page1'$data);
$this->load->view('page/page2'$data);
etc

How this would help you to find errors more easily, isn't clear to me. Does it matter if you get an error message that says: error on line 1500 of 'page1', instead of line 3000 of 'page' ?? In both cases, it's obvious where to look, isn't it? Provided that you are using a code editor with line numbers, of course.
If you need 4000 lines of code for a view file, I'm affraid you're doing something basically wrong. How did you end up with such a large php file?