我正在尝试将Kint加载到我的第一个 Phalcon 项目中。我正在尝试使用loader.php
来这样做。我尝试使用“registerDirs”、“registerClass”和“registerNamespaces”。
我习惯于通过 composer 在 Symfony2 中使用 Kint,但这次我尝试克隆 git repo 并将其放在这个 Pahlcon 项目的供应商文件夹中。我在require
使用 Kint 类时得到的只是一个静默的 500 内部错误。以下是我目前拥有的代码。
<?php
# app/config/loader.php
$loader = new \Phalcon\Loader();
/**
* We're a registering a set of directories taken from the configuration file
*/
$loader->registerDirs(
array(
$config->application->controllersDir,
$config->application->modelsDir,
'~/Code/incubator/Library/Phalcon',
"vendor/kint"
)
)->register();
和有问题的控制器:
<?php
# app/controllers/indexController.php
class IndexController extends ControllerBase
{
public function indexAction()
{
Kint::dump("huh");
}
}