gpt4 book ai didi

php - 如何在 Bisna 中正确加载 DoctrineExtensions?

转载 作者:可可西里 更新时间:2023-11-01 13:21:41 25 4
gpt4 key购买 nike

我正在尝试加载一些学说扩展,但出现了各种错误。到目前为止,这就是我所拥有的

在我的 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/'

在我的一个 Controller 中:

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

这是错误:

Warning: include_once(DoctrineExtensions/Paginate.php): failed to open stream: No such file or directory

最佳答案

尝试一些简单的事情

 //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;

然后尝试重置代码

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

$result = $paginateQuery->getResult();

让我知道这是怎么回事

干杯:)

注意:我还没有测试这段代码

关于php - 如何在 Bisna 中正确加载 DoctrineExtensions?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7785866/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com