Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-19-2008, 01:49 PM
Member
 
Join Date: Feb 2008
Posts: 46
Question Zend_Model is not there.?

Hai all,

I understood the Controller and the View Creation. But i could not identify the Model files in this ZFwork. can any one tell me how we can add this Model? and how we can call the function from there?

Thanks
Mugesh.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-19-2008, 03:11 PM
Senior Member
 
Join Date: Jan 2008
Location: chicago
Posts: 101
Default

It IS possible to make a Zend Framework application without ever having to use Models.

For models, you will be deriving a class from the abstract class Zend_Db_Table. Each model will represent a table in your database.

Store these classes in application/models/. Each file should only define one class.

You have to make sure that this directory is in the include_path. This is done in the bootstrap file.

Please refer to Zend_Db_Table in this exceptional tutorial on page 12:
Akra’s DevNotes Tutorial: Getting Started with the Zend Framework
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-20-2008, 06:46 AM
Member
 
Join Date: Feb 2008
Posts: 46
Question How to pass the values thru query string?

Thanks you. One more doubt.

My application url is: http://localhost/html/index.php/user/list
This is for listing the users. To do edit option, i need to pass the id=2 in the same url.
(http://localhost/html/index.php/user/list/id=2) LIKE THIS;
while doing like this, its not working. Then how can i pass these kind of information thru url?

-Mugesh.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-20-2008, 08:09 PM
Senior Member
 
Join Date: Jan 2008
Location: chicago
Posts: 101
Default

it should be

http://localhost/user/list/id/2
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-20-2008, 08:14 PM
Senior Member
 
Join Date: Jan 2008
Location: chicago
Posts: 101
Default

To use that variable you would then do

PHP Code:
$id $this->_request->getPost('id'); 
To check if Post variables exist, you do

PHP Code:
if($this->_request->isPost()) {
    
blah blah blah;

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:52 PM.