Passing parameters through an extended library class? |
[eluser]Wayne Smallman[/eluser]
Hi guys! I'm building PDF functionality into an application via FPDF, and all is (almost) working fine. And to make the FPDF truly useful, I've made it a globally available library. However, I need to pass parameters to the class, which isn't going according to plan. Code: function FPDF($orientation='P', $unit='mm', $size='A4') {... Code: class Export extends FPDF { Code: $this->load->library('invoices/export', array('orientation' => 'L', 'unit' => 'mm', 'size' => 'A4')); Any ideas how I get that to work?
[eluser]Aken[/eluser]
Load your library the same as you have shown, but make sure your extended class controller's construct function includes something to handle a parameters array. Code: class Export extends FPDF {
[eluser]Wayne Smallman[/eluser]
[quote author="Aken" date="1312030195"]Load your library the same as you have shown, but make sure your extended class controller's construct function includes something to handle a parameters array. Code: class Export extends FPDF { I'll give that a try later on today and see how things go. |
Welcome Guest, Not a member yet? Register Sign In |