Doctrine 2 和 CodeIgniter 入门

发布于 2024-12-03 20:37:49 字数 828 浏览 0 评论 0原文

我读《教义》已经有一段时间了,它看起来确实很有趣。

我已经阅读了 phpandstuff.com 上的大部分教程,但我意识到它们目前已经过时了。然而,这些教程确实展示了 Doctrine 的用处。

我现在正在寻求有关如何开始使用 Doctrine 的建议,最好与 CodeIgniter 结合使用。我了解 CI 的方式,所以我更喜欢与该框架集成。

很难找到关于将 Doctrine 2.1 与 CI 2.0.x 集成的像样指南,但是在遵循 这个指南,我似乎已经成功了。我现在已经安装了一个可以运行的 CI,并且集成了 Doctrine。

我想任何人能给我的最好建议就是RTFM。但是,如果可能的话,我想要一些更深入的建议。

我应该先在没有 CI 的情况下浏览 Doctrine 教程/示例,然后再返回 CI 安装,还是可以在使用新的 CI 安装时尝试完成这些教程?

有谁知道有关 Doctrine 入门的任何不错的指南/书籍/博客吗?最好是 phpandstuff.com 教程之类的内容,但是是最新的。或者,对于那些阅读过这些教程的人来说,它们仍然适用于 Doctrine/CI 2+ 吗?

我正在寻找一个起点,因为有很多信息需要找到,但似乎还有很多过时的信息。我将尽快完成 Doctrine 文档,但我对任何其他指南/教程/书籍/等感兴趣。我能找到。

预先非常感谢。

I've been reading about Doctrine for a while now and it surely looks interesting.

I have read through most of the tutorials on phpandstuff.com, but I realise they're way outdated at the moment. However, those tutorials did really show the usefulness of Doctrine.

I am now looking for advice on how to get started with Doctrine, preferably in combination with CodeIgniter. I know my way around CI, so I'd prefer to integrate with that framework.

It was fairly hard to find a decent guide on integrating Doctrine 2.1 with CI 2.0.x, but after following this guide, I seem to have succeeded at it. I now have a working CI install with integrated Doctrine.

I suppose the best advice anyone could give me is to RTFM. However, I'd like some more in-depth advice, if possible.

Should I go through the Doctrine tutorials/examples first without CI and then make my way back to the CI install, or would it be possible to try and work through the tutorials while using my new CI installation?

Does anyone know of any decent guides/books/blogs on getting started with Doctrine? Preferably something like the phpandstuff.com tutorials, but up to date. Or, for those having read those tutorials, are they still applicable to Doctrine/CI 2+?

I'm looking for a starting point here as there's a lot of information to be found, but it seems like there's also a lot of outdated information out there. I'll be working through the Doctrine documentation asap, but I'm interested in any other guides/tutorials/books/etc. I can find.

Thanks a lot in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

木緿 2024-12-10 20:37:49

首先我要说的是,不,我不知道有任何像样的 Doctrine 入门指南。如果您了解如何使用 PHP 作为面向对象的语言(类、继承、命名空间等),那么您学习 Doctrine 2 应该不会有任何困难,因为它的设计方式使您只需创建和访问常规 PHP 类即可。你是绝对正确的 - 阅读文档是(在我看来)教义的最佳起点。

您可以从创建一个简单的系统(例如博客)开始;这应该可以帮助您掌握 Doctrine 如何处理关联,并让您有机会使用命令行实用程序。当您觉得需要更多功能或遇到困难时,文档几乎总是足以帮助您,如果没有,SO 有数千个与 Doctrine 相关的问题和信息。答案。

请记住,原则 2 不应该很复杂。它应该是一个透明层,允许您作为 PHP 类访问数据库。

I'll start off by saying that no, I don't know of any decent guides for getting started on Doctrine. If you understand how to use PHP as an object-oriented language (classes, inheritance, namespaces, etc) then you should have no trouble learning Doctrine 2 because it has been designed in such a way that you are simply creating and accessing regular PHP classes. You are absolutely right - reading the documentation is (in my opinion) the best place to start with Doctrine.

You could start by creating simple a simple system like a blog; this should help you get to grips with how Doctrine handles associations and give you a chance to use the command line utility. When you feel like you need more functionality or you're stuck on something, the documentation will almost always be enough to help you out and if not, SO has thousands of Doctrine-related questions & answers.

Just remember, Doctrine 2 is not supposed to be complicated. It is supposed to be a transparent layer that lets you access your database as PHP classes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文