【问题标题】:auto-loading the doctrine 2 with codeigniter 2.1.0使用 codeigniter 2.1.0 自动加载学说 2
【发布时间】:2012-04-21 17:11:44
【问题描述】:

我在使用 codeigniter 2.1.0 自动加载学说 2 时遇到问题, 我正在关注本教程 http://www.phpandstuff.com/articles/codeigniter-doctrine-from-scratch-day-1-install-and-setup 我应该打开 autoload.php 文件并像这样加载学说:

$autoload['plugin'] = array('doctrine');

但问题是没有 $autoload['plugin'] = array();在我的 autoload.php 中

那么如何加载学说?

【问题讨论】:

    标签: codeigniter doctrine-orm


    【解决方案1】:

    那篇 phpandstuff 文章太旧了,不适合教条1。将此用于 CI2 和 Doctrine2 https://github.com/rubensarrio/codeigniter-hmvc-doctrine

    你需要设置一个库类和设置学说类加载器。

    【讨论】:

    • 我几乎所有的项目都使用它,它是 CI2 和 Doctrine 的最佳集成。如果对您有帮助,请标记为已接受;)
    • 嗨,我想知道使用 codeigniter $this->doctrine 是否会给我一个数据库连接的单例实例?或者这取决于我如何制作我的教义课?
    【解决方案2】:

    如果我是对的,自 CodeIgniter 的 2.0 版以来,该插件已被删除并添加了几乎相同的帮助程序类。
    我认为您应该将您的plugin 转换为helper

    yourplugin_pi.php => yournewhelper_helper.php

    然后你可以将它添加到辅助部分的自动加载文件中:

    http://codeigniter.com/user_guide/installation/upgrade_200.html

    【讨论】:

      猜你喜欢
      • 2017-04-09
      • 2014-08-13
      • 1970-01-01
      • 1970-01-01
      • 2013-12-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-16
      相关资源
      最近更新 更多