CodeIgniter 支持 AJAX 和 ORM

发布于 2024-12-13 16:24:19 字数 104 浏览 0 评论 0原文

我正在为我的下一个项目寻找一个好的 php 框架,我发现 CodeIgniter 很合适,但是我在某处读到了“codeIgniter 没有 ORM(对象关系映射),没有 AJAX 支持”,是吗?

I was searching for a good php framework for my next project, and I found that CodeIgniter is suitable, but I read this somewhere "codeIgniter has No ORM(Object Relational Mapping), No AJAX support", is that right?

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

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

发布评论

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

评论(2

轻许诺言 2024-12-20 16:24:19

“codeIgniter没有ORM(对象关系映射)

TRUE。但它有一个漂亮且方便的自定义 Active Record类充当ORM,从2.0.3开始支持多种数据库驱动,支持的数据库有mysql、mysqli、postgre、odbc、mssql、 如果您愿意,您可以将您最喜欢的 ORM 添加到库或驱动程序中,

然后您可以使用它来代替,如果您坚持这个过程,那么有很多教程和答案。非常简单,手册非常清楚如何创建/使用自定义库。

不支持 AJAX

无论这意味着什么,这都是不正确的。 CI 是一个用于 Web 开发的 php 框架,因此在视图中编写 javascript ajax 代码,调用正确的控制器方法,AJAX 就会正常工作。

如果您的意思是没有对此的本机支持,即使用本机类来完成任务,那么它部分正确。 CI 有 javascript 类,它是一个加载器/帮助器jQuery;我从未使用过它,因为我更喜欢自己加载该框架并直接对其进行操作,但您可以尝试一下。

"codeIgniter has No ORM(Object Relational Mapping)

TRUE. But it has a nice and handy custom Active Record class which acts as an ORM, supporting many database drivers; as of 2.0.3, supported databases are mysql, mysqli, postgre, odbc, mssql, sqlite, oci8.

And, if you want, you can just add your favourite ORM to the libraries or drivers and you can use that instead. There are many tutorials out there and answers on SO if you're stuck with this procedure, though it's pretty easy and the manual is really clear on how to create/use custom libraries.

No AJAX support

Whatever this means, it's not true. CI is a php framework for web development, so write your javascript ajax code inside views, call the right controller's method, and AJAX will work just fine.

If you mean there's no native support for that, i.e. using native classes to the task, then it's partly right. CI has the javascript class which is a loader/helper for jQuery; I never used it since I prefer loading that framework by myself and working directly on that, but you might give it a try.

仲春光 2024-12-20 16:24:19

是的,CI 没有内置 ORM。但它支持不同的库和类,充当ORM
例如:

doctrine数据映射器

可以与codeigniter一起使用来满足您的要求。

CI 对 AJAX 的支持 而言,AJAX 与 codeigniter 配合得很好。使用 Ajax 进行开发时请记住,如果有人在浏览器中关闭了 Javascript,您开发的内容将无法工作。

希望这有帮助。

Yes, CI has no built-in ORM. but it supports different libraires and classes which acts as ORM.
for example:

doctrine and data mapper

can be used along with codeigniter to fulfill your requirements.

as far as CI support for AJAX is concerned, AJAX works perfectly fine with codeigniter. Do keep in mind when developing using Ajax, that if someone turns off Javascript in their browser, what you develop will not work.

Hope this helps.

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