Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Class 'Picqer\Barcode\BarcodeGenerator' not found #16

Closed
anuj9196 opened this issue Sep 26, 2016 · 4 comments
Closed

Error: Class 'Picqer\Barcode\BarcodeGenerator' not found #16

anuj9196 opened this issue Sep 26, 2016 · 4 comments

Comments

@anuj9196
Copy link

anuj9196 commented Sep 26, 2016

I'm using php-barcode-generator in CakePHP framework.
I have installed plugin in vendor directory and using it in my controller

require_once(ROOT.'/vendor/picqer/php-barcode-generator/src/BarcodeGeneratorHTML.php');
  public function shippingSlipPrint($order_id = null)
    {
        $generator = new BarcodeGeneratorHTML();
        $barcode = $generator->getBarcode('1234567890', $generator::TYPE_CODE_128);

        $this->set('barcode', $barcode);

    }

But this is giving error as

Error: Class 'Picqer\Barcode\BarcodeGenerator' not found
File /myapp/vendor/picqer/php-barcode-generator/src/BarcodeGeneratorHTML.php
Line: 6 

content of BarcodeGeneratorHTML.php

<?php

namespace Picqer\Barcode;

class BarcodeGeneratorHTML extends BarcodeGenerator
{
     .....
    ......
}
@casperbakker
Copy link
Member

casperbakker commented Sep 26, 2016

Then you also need to require the ROOT . '/vendor/picqer/php-barcode-generator/src/BarcodeGenerator.php' file

With Composer we use Autoload, which loads this files automatically.

@amirvenus
Copy link

I am having a similar issue as I could not use composer.

Please advise

@casperbakker
Copy link
Member

It is just basic PHP, require/include the proper file before you can use it.

@amirvenus
Copy link

I fixed the problem by requiring autoload file.

Thanks and keep up the good work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants