【发布时间】: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