Part of the EllisLab Network
   
 
One method - many views
Posted: 21 October 2008 09:26 AM   [ Ignore ]  
Summer Student
Total Posts:  6
Joined  08-20-2008

How to in one method add many views ?

public function active()
    
{
        $this
->load->model('survey_model');
        
$this->load->library('auth');
        
$this->data = array('survey' =>  $this->survey_model->loadPublished($this->auth->getUser()->userId));
        
$this->load->library('design');
        
$this->design->header('header_logged');
                
//one view i need 4
        
$this->load->view('/survey/active',$this->data);
        
$this->design->footer('footer_logged');
        
    
Profile
 
 
Posted: 21 October 2008 09:33 AM   [ Ignore ]   [ # 1 ]  
Sr. Research Associate
RankRankRankRankRank
Total Posts:  4785
Joined  07-14-2006

Can you give more information? Are the 4 view parts of one page or are it 4 different contents?

Profile
 
 
Posted: 21 October 2008 09:36 AM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  6
Joined  08-20-2008

Content from 1 table on 4 pages

Profile
 
 
Posted: 21 October 2008 10:25 AM   [ Ignore ]   [ # 3 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  286
Joined  02-13-2008

Add another 4 methods that are using fifth to get data?

Profile
 
 
Posted: 23 October 2008 11:01 AM   [ Ignore ]   [ # 4 ]  
Summer Student
Total Posts:  6
Joined  10-16-2008

Do this:

$this->load->view('header',$this->data);
$this->load->view('body');
$this->load->view('footer'); 

once loaded $this->data will be accessible within every page (header, body and footer)

Regards

Profile