函数名. 例:D("User")->getList(); 调用 UserModel.php 文件中 的"/>
PHP头条
热点:

ThinkPHPModel与Action用法


一直听说ThinkPHP可以使用Model调取数据库,今日才会用Model,在Action中使用D方法条用Model中函数.

D("Model名字")->函数名.

例:D("User")->getList();

调用  UserModel.php 文件中 的 function getLiser() 函数,在Model下的函数使用 $this 代表实例化当前 Model名字的表,Model下文件一般以  数据库表名+Model.php 命名

www.phpzy.comtrue/phpkj/3045.htmlTechArticleThinkPHPModel与Action用法 一直听说ThinkPHP可以使用Model调取数据库,今日才会用Model,在Action中使用D方法条用Model中函数. D("Model名字")->函数名. 例:D("User")->getList(); 调用 UserModel.php 文件中 的...

相关文章

相关频道:

PHP之友评论

今天推荐