WkHtmlToPdf组件,Auth

的问题 我正在尝试使用WkHtmlToPdf组件,它在面对生成pdf文件的问题时似乎是一个很好的工具。 但是 - 我无法使用Auth组件。问题是我总是将生成的登录页面设为pdf。我已经登录了,这个动作在beforeFilter中被允许,但它仍然以某种方式妨碍了它。 编辑: AppController的:
var $components = array('Auth', 'Session');

function beforeFilter()
  {
  $this->Auth->logoutRedirect = array('controller' => 'users', 'action' => 'login');

  if (!$this->Auth->user())
    {
    $this->layout = 'login';
    }  
  }
控制器:
var $components = array('WkHtmlToPdf');

function beforeFilter() // I am logged in, so this shouldn't even be needed
  {
  $this->Auth->allow('pdf');
  }

function pdf()
  {
  $this->WkHtmlToPdf->createPdf();
  }

// this function is required for wkhtmltopdf to retrieve
// the viewdump once it's rendered
function getViewDump($fileName)
  {
  $this->WkHtmlToPdf->getViewDump($fileName);
  }
任何帮助将不胜感激, 保罗     
已邀请:
事实证明,你必须允许
getViewDump
方法。它似乎不适用于Auth,但没有任何威胁允许它适用于每个人,它的工作原理。 控制器:
function beforeFilter()
    {
    parent::beforeFilter();
    $this->Auth->allow('getViewDump');
    }
    

要回复问题请先登录注册