Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function indexAction()
- {
- $this->authoriseUser();
- //get id param from index.phtml (view)
- $id = $this->getRequest()->getParam('club_id');
- //get model and query by $id
- $clubs = new Application_Model_DbTable_Clubs();
- $clubs = $clubs->getClub($id);
- //assign data from model to view [EDIT](display.phtml)
- $this->view->clubs = $clubs;
- }
- public function addAction() {
- //action for the comments submission
- $form = new Application_Form_Comment();
- $form->submit->setLabel('Comment');
- $this->view->form = $form;
- if ($this->getRequest()->isPost()) {
- $formData = $this->getRequest()->getPost();
- if ($form->isValid($formData)) {
- $comment = new Application_Model_DbTable_Comments();
- $comment->addComment($formData['comment'], $id);
- $this->_helper->redirector('index');
- } else {
- $form->populate($formData);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment