Reload Or Refresh Current Page

Hi All,

I have the following problem.

I currently create a pdf file in a different class than the controller. The PDF generation works and all I want after that is to go back to the page it came from. Thus basically just to reload/refresh the page. I need this, because the page displays different links based on if the PDF was generated or not. I click a link on my page which calls my controller, inside my controller method, I currently have this code:




  $genpdf = new GenPDF();

  $genpdf->generatePDFFile();

  Yii::app()->getController()->redirect(array('/site/printinvoice'));



But I get a Headers Already Sent error which I suppose is because of the PDF generation. Is there another way to just go back to the current page?

Thanks

Sorry, don’t worry about it. It is working now, had some space in my PDF generation class which caused the Headers already sent problem.

1 Like