How to load DoctrineExtensions in Bisna?

I try to download some doctrine extensions, but I get all kinds of errors. So far this is what I have

In my ini:

autoloaderNamespaces[] = "DoctrineExtensions" resources.doctrine.classLoader.loaderClass = "Doctrine\Common\ClassLoader" resources.doctrine.classLoader.loaderFile = "Doctrine/Common/ClassLoader.php" resources.doctrine.classLoader.loaders.DoctrineExtensions_Paginate.namespace = "DoctrineExtensions\Paginate" resources.doctrine.classLoader.loaders.DoctrineExtensions_Paginate.includePath = APPLICATION_PATH '/../library/Doctrine/DoctrineExtensions/Paginate/' 

And in one of my controllers:

  $count = Paginate::getTotalQueryResults($query); // Step 1 $paginateQuery = Paginate::getPaginateQuery($query, $offset, $limitPerPage); // Step 2 and 3 $result = $paginateQuery->getResult(); 

And this is a mistake:

Warning: include_once (DoctrineExtensions / Paginate.php): could not open the stream: there is no such file or directory

+6
source share
2 answers

Try something simple

  //include class loader first //make sure this is correct $doctrine_root=APPLICATION_PATH. '/../library/Doctrine'; require_once $doctrine_root.'/Common/ClassLoader.php'; $classLoader = new \Doctrine\Common\ClassLoader('Doctrine',$doctrine_root); $classLoader->register(); user Doctrine\DoctrineExtensions\Paginate; 

Then try resetting the code

  $count = Paginate::getTotalQueryResults($query); // Step 1 // Step 2 and 3 $paginateQuery = Paginate::getPaginateQuery($query, $offset, $limitPerPage); $result = $paginateQuery->getResult(); 

let me know how it works

greetings :)

Note: I have not tested this code at my end

+3
source

I suggest you try this plugin: beberlei / DoctrineExtensions

And here are the details on how to integrate it into your project: README

I don’t think you can do this because the developer built the extensions !: S

To use autoload for the Paginate class, the class had to be called by DoctrineExtensions_Paginate_Paginate .

Good luck

+3
source

Source: https://habr.com/ru/post/899405/


All Articles