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
精彩评论