龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > php编程 >

如何让CI框架支持service层(3)

时间:2014-10-30 16:19来源:网络整理 作者:网络 点击:
分享到:
复制代码 代码如下: php class User_model extends CI_Model { public function __construct() { parent::__construct(); } public function get_user_by_where($name, $password) { //$this-db //...... //

复制代码 代码如下:

<?php
class User_model extends CI_Model
{
    public function __construct()
    {
        parent::__construct();
    }
    public function get_user_by_where($name, $password)
    {
        //$this->db
        //......
        //......
        return array('id' => 1, 'name' => 'mckee');
    }
}

基本实现思路就是这样的。

精彩图集

赞助商链接