【问题标题】:Zend Framework and CodeIgniter Model class doubtsZend Framework 和 CodeIgniter Model 类的疑惑
【发布时间】:2011-03-04 09:55:48
【问题描述】:

zend 和 CI 框架都有单独的 Model、View、Controller 目录。我的疑问是如何在 Zend Framework 中使用模型。

[CodeIgniter 控制器]

<?php
class Users extends CI_Controller
{
    function __construct()
    {
        parent::__construct();
        $this->load->model('users_model');
    }

    function index()
    {
        // here i am using model function //
        $myvar = $this->user_model->login();
    }
}
?>

[Zend 框架控制器]

<?php
class UsersController extends Zend_Controller_Action
{
    public function indexAction()
    {
        // how to load model and use here ???? //
    }
}
?>

在 CodeIgniter 控制器中,我加载模型“users_model”并在索引函数中使用。同样如何创建zend模型并在控制器中使用?请帮帮我,对不起我的英语不好。

感谢朋友们, 拉金德拉

【问题讨论】:

    标签: zend-framework codeigniter frameworks model controller


    【解决方案1】:

    您不应该将 Zend 与 CodeIgniter 进行比较,因为它们的理念完全不同。

    最好阅读: http://framework.zend.com/manual/en/learning.quickstart.create-model.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-29
      • 1970-01-01
      • 2013-08-12
      • 1970-01-01
      • 2010-12-08
      • 2020-11-02
      • 1970-01-01
      • 2013-02-13
      相关资源
      最近更新 更多