cut a view into pieces

Hi All

I have this huge view php file, which would be easier for me to maintain if I could cut it into smaller pieces.

What would be the correct way to do this ?

cheers

Put the pieces into _someView.php files and call them with renderPartial

I guess you don’t mean that I should call ‘renderPartial’ within a view, but in a controller?!

But, and I admit I wasn’t clear about this, its not that I can cut my page into pieces like row 1 to 100 into _somefile.php, 101 to 200 into _anotherfile.php

For me it would be best to have a layout file, and insert content into multiple places. Something like:




<html>

   <head

       <?php echo $content; ?>

   </head>

   <body>

       <header>

           <?php echo $content; ?>

       </header>

       <content>

            <?php echo $content; ?>

    

     etc etc



and of course I want this content to come from different files!!

Calling renderPartial from a view file is quite normal and is the normal way to split a view into smaller chunks. Or you can start farming them out as widgets.

Ok, renderPartial it is. Thanks a lot