小编Ale*_*len的帖子

在Codeigniter中编写模型代码的最佳方法是什么

关于在codeigniter中使用哪种技术来编写模型,我非常困惑.

我搜索了很多,发现了各种程序员使用的各种方法.请指导我使用codeigniter编写Model Class的最佳方法.

几个例子;

  • 有些在Method签名中使用长参数

     function insert_data($name, $address, $email, $....,$...,$..)
    
    Run Code Online (Sandbox Code Playgroud)

    其他人只需使用以下内容并在模型中写下所有帖子代码.

    function insert()
    { 
    $name= $this->input->post('var1');
    $name= $this->input->post('var1');
    $name= $this->input->post('var1');
    }
    
    Run Code Online (Sandbox Code Playgroud)
  • 有些为每个表创建不同的模型,而有些只写很少的模型..

    而且不同开发人员之间存在更多矛盾,我对使用哪种技术编写更高效的行业标准代码感到困惑.

    请指导我非常感谢

php codeigniter

5
推荐指数
1
解决办法
2487
查看次数

标签 统计

codeigniter ×1

php ×1