开发者

Zend Framework and CodeIgniter Model class doubts

开发者 https://www.devze.com 2023-02-14 23:23 出处:网络
Both zend and CI framework have seperate Model, View, Controller directories. My doubt is how to use model in Zend Framework.

Both zend and CI framework have seperate Model, View, Controller directories. My doubt is how to use model in Zend Framework.

[ CodeIgniter Controller ]

<?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 Framework Controller ]

<?php
class UsersController extends Zend_Controller_Action
{
    public function indexAction()
    {
        // how to load model and use here ???? //
    }
}
?>
开发者_JAVA百科

In CodeIgniter Controller I load model "users_model" and used in index function. In the same way how to create zend model and use in controller? please help me, sorry my english is not good.

Thanks friends, Rajendra


You shouldn't compare Zend with CodeIgniter since the philosophy is quite different.

It is best to read: http://framework.zend.com/manual/en/learning.quickstart.create-model.html

0

精彩评论

暂无评论...
验证码 换一张
取 消