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

[eluser]resolv_25[/eluser]
Hello,
Couldn't find the solution on wiki or forum.
Is it possible to have load->view on target=>blank.

I want to use same function in controller for filling the data and afterward display the same
view on blank page for printing.

So, I have something like:
Code:
if($print1 == 0) {
      $data['print1'] = 0;
      $this->load->view('zbrojnalog/zbrojnalog_view', $data);    
}
else {
      $data['print1'] = 1;
      $data['date1'] = $date1;
          
      // load on blank page – of course this bellow isn't working
      $this->load->view('zbrojnalog/zbrojnalog_view'_blank , $data);
}
#2

[eluser]danmontgomery[/eluser]
You can use anchor_popup (http://ellislab.com/codeigniter/user-gui...elper.html) to open a popup. All you need for a "blank" page is to just not output any other content... This is completely within your control
#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.




Theme © iAndrew 2016 - Forum software by © MyBB