I am trying to load some doctrine extensions but I get all sort 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 the error:
Warning: include_once(DoctrineExtensions/Paginate.php): failed to open stream: No such file or directory
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 reset of 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 this works
cheers :)
Note : I haven't tested this code at my end
I suggest you try this plugin: beberlei / DoctrineExtensions
And here are the details on how to integrate it into your project: README
I do not think you can do so for as the developer has built the extensions! :S
In order to use the autoload for the class Paginate
, the class should have been called DoctrineExtensions_Paginate_Paginate
.
Good Luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With