cakephp - use different layout not working -
cakephp - use different layout not working -
for download action want utilize layout created pdf.ctp
here action in controller
function download($id = null) { $this->layout = 'pdf'; // include component app::import('component', 'pdf'); // create instance $pdf = new pdfcomponent(); // invoice name (output name) $pdf->filename = 'contract'; // without .pdf // can utilize download or browser here $pdf->output = 'download'; $pdf->init(); // render view $pdf->process(router::url('/', true) . 'pv/pdf_contract/'); $this->render(false); }
but still using default layout. not sure why thanks
i figured out. needed $this->layout=false in referencing method , not in actual download method. thanks
cakephp cakephp-2.0
Comments
Post a Comment