[英]Laravel 4 model without eloquent
I'm just starting to learn about Laravel and trying to migrate from CI. 我刚刚开始学习Laravel,并尝试从CI迁移。 I have a few simple questions. 我有几个简单的问题。
I guess number 1 and 2 questions are somehow related. 我猜第一个和第二个问题在某种程度上是相关的。
You can use fluent: 您可以使用流利的语言:
DB::table("...");
Eloquent, which is based on PDO is ORM and more abstracted from raw queries. 雄辩的,基于PDO的是ORM,并且从原始查询中抽象出来。
Eloquent is a great tool, so I recommend familiarizing yourself with it if you get the chance. 口才是一个很棒的工具,因此,如果有机会,我建议您先熟悉一下。
You can build queries on your own using Laravel's query builder. 您可以使用Laravel的查询构建器自行构建查询。
Read up on it here, I hope this answers your question and sorry if I misunderstood! 在这里阅读它,我希望这能回答您的问题,如果我误解了,对不起!
http://laravel.com/docs/queries http://laravel.com/docs/queries
Good luck! 祝好运!
I think you can`t create a model without extends eloquent
like laravel 4 Doc 我认为您不能像laravel 4 Doc那样扩展eloquent
创建模型
class User extends Eloquent {}
because a model in laravel based into eloquent ORM
unlike CodeIgniter
因为 laravel中的模型基于eloquent ORM
与CodeIgniter
不同)
If you need to deal with database tables with creating models ,you can use DB
class like laravel 4 Doc 如果您需要通过创建模型来处理数据库表,则可以使用laravel 4 Doc这样的DB
类。
DB::select('')
and DB::table('')
DB::select('')
和DB::table('')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.