它说Class 'cossou\JasperPHP\JasperPHP' not found
。
我使用这个类作为命名空间
$jasper = new JasperPHP;
//jasper ready to call
$jasper->compile(__DIR__ . '/../../vendor/cossou/jasperphp/examples/hello_world.jrxml')->execute();
// Process a Jasper file to PDF and RTF (you can use directly the .jrxml)
$jasper->process(
__DIR__ . '/../../vendor/cossou/jasperphp/examples/hello_world.jasper',
false,
array("pdf", "rtf"),
array("php_version" => phpversion())
)->execute();
// List the parameters from a Jasper file.
$array = $jasper->list_parameters(
__DIR__ . '/../../vendor/cossou/jasperphp/examples/hello_world.jasper'
)->execute();
return $this->redner('view');
答案 0 :(得分:0)
添加到您的文件顶部
use JasperPHP\JasperPHP as JasperPHP
然后将其称为
$jasper = new JasperPHP;