CodeIgniter 支持 AJAX 和 ORM
我正在为我的下一个项目寻找一个好的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
TRUE。但它有一个漂亮且方便的自定义 Active Record类充当ORM,从2.0.3开始支持多种数据库驱动,支持的数据库有mysql、mysqli、postgre、odbc、mssql、 如果您愿意,您可以将您最喜欢的 ORM 添加到库或驱动程序中,
然后您可以使用它来代替,如果您坚持这个过程,那么有很多教程和答案。非常简单,手册非常清楚如何创建/使用自定义库。
无论这意味着什么,这都是不正确的。 CI 是一个用于 Web 开发的 php 框架,因此在视图中编写 javascript ajax 代码,调用正确的控制器方法,AJAX 就会正常工作。
如果您的意思是没有对此的本机支持,即使用本机类来完成任务,那么它部分正确。 CI 有 javascript 类,它是一个加载器/帮助器jQuery;我从未使用过它,因为我更喜欢自己加载该框架并直接对其进行操作,但您可以尝试一下。
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.
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.
是的,
CI 没有内置 ORM
。但它支持不同的库和类
,充当ORM
。例如:
doctrine 和 数据映射器
可以与codeigniter一起使用来满足您的要求。
就
CI 对 AJAX 的支持
而言,AJAX 与codeigniter
配合得很好。使用 Ajax 进行开发时请记住,如果有人在浏览器中关闭了 Javascript,您开发的内容将无法工作。希望这有帮助。
Yes,
CI has no built-in ORM
. but it supports differentlibraires and classes
which acts asORM
.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 withcodeigniter
. Do keep in mind whendeveloping using Ajax
, that if someone turns offJavascript
in their browser, what you develop will not work.Hope this helps.