php - Class 'PHPJasper\PHPJasper' not found? -


i have app laravel 5.4.9 php 7.0.2.

i installed need install php jasper, url: https://github.com/phpjasper/phpjasper running

$ composer require geekcom/phpjasper:~1.16 

followed running

$ composer install 

i believe have installed correctly, when try use below code :

use phpjasper\phpjasper; 

it throws following error:

fatalthrowableerror in mycontroller.php line 714:

class 'phpjasper\phpjasper' not found

how can fix this?

as pointed out @ https://github.com/phpjasper/phpjasper#the-hello-world-example, need initialize composer autoloader first requiring vendor/autoload.php.

<?php  require_once __dir__ . '/vendor/autoload.php';  use phpjasper\phpjasper;  $jasper = new phpjasper; 

since appears have sort of web application, have entry point, front controller perhaps. require vendor/autoload.php there, , adjust path match directory structure.

for reference, see https://getcomposer.org/doc/01-basic-usage.md#autoloading.


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -