Thursday, August 2, 2012

Re: CakePdf - How To Start?

This is what I have done so far:

1. CakePdf is in my Plugin folder.

2. bootstrap.php has at the bottom:
/* LOAD CakePdf PLUGIN */
CakePlugin::load('CakePdf', array('bootstrap' => true, 'routes' => true));
Configure::write('Pdf',
  array(
    'prefix' => 'pdf',
    'engine' => 'tcpdf'
  ));

3. FormsController.php has this function
    public function pdf_view($id = null)
    {
               
        $this->Form->id = $id;
        if (!$this->Form->exists()) {
            throw new NotFoundException(__('Invalid form'));
        }
        $this->set('form', $this->Form->read(null, $id));
    }

4. I have setup a template file at: /app/View/Layouts/pdf/default.ctp

5. I have setup the view file at: /app/View/Forms/pdf/view.ctp


I am getting this error (please note I also tried the view.ctp as pdf_view.ctp in the /app/View/Forms/ folder but it just rendered the html to the page without the error, still no pdf)

Error: The view for FormsController::pdf_view() was not found.

Error: Confirm you have created the file: /home/beanclai/public_html/app/View/Forms/pdf_view.ctp

Any idea where I am going wrong? Thanks

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: