Welcome Guest, Not a member yet? Register   Sign In
load->view blank?
#3

[eluser]resolv_25[/eluser]
Thanks for your reply.
anchor_popup() is another useful function.
Still, it doesn't fit to my needs because I need to pass data from the controller to the view,
actually, almost the same as in the first option ($print==0)

If possible, I don't like to write almost the same method again, or break it on the pieces because of this.

Controller is something like this (shortly):
Code:
function priprema($print1=0) {
        if($print1 ==1){
            $datum1 = $this->input->post('datum1');
        }
        
        $this->load->model('maticni/skolamodel','',TRUE);
        $skola = $this->skolamodel->list_all()->row();
        $data['skolanaziv'] = $skola->naziv;
        $data['skolaziro'] = $skola->ziro;
// etc.  - loading  more data....
        if($print1 == 0) {
            $data['print1'] = 0;
            $this->load->view('zbrojnalog/zbrojnalog1_view', $data);    
        }
        else {
            $data['print1'] = 1;
            $data['datum1'] = $datum1;
            
            // ???? load view on blank page
            $this->load->view('zbrojnalog/zbrojnalog1_view', $data);    
        }

}

View is something like this:

Code:
<html>
<body>
<?php
  if($print1 == 0) {
     echo form_open('zbrojnalog/zbrojnalog/priprema/1');
     $datum1 = date("d.m.Y");
     echo "<input type='text' name ='datumpredaje' value='$datum1' >";
    
  }
  else {
     echo $datum1;    
}
?>
some html - filling the data from controller
<?php
  if($print1 == 0) {
       echo "<br>&lt;input class='button' id='Unos' name='print' type='submit'  value='Print' /&gt;
        &lt;/form&gt;";
  }
?&gt;
&lt;/body&gt;
&lt;/html&gt;

So, after getting the post value of datum1 I want to return it to the view and print it out.
Not sure that I'm on the right path.


Messages In This Thread
load->view blank? - by El Forum - 05-05-2010, 12:56 PM
load->view blank? - by El Forum - 05-05-2010, 12:59 PM
load->view blank? - by El Forum - 05-05-2010, 01:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB