Exemplo n.º 1
0
 /**
  * STAGE 3:  Choose, create, and optionally update models using business logic.
  * STAGE 4.  Apply business logic to create a presentation model for the view.
  */
 protected function displayStage3_4()
 {
     // the posts and topics models auto-instantiate themselves, as needed (STAGE 3)
     $this->view->posts = ZFDemoModel_Posts::getPostsByTopicId($this->topicId);
     $this->view->topicId = $this->topicId;
     // the posts and topics models auto-instantiate themselves, as needed (STAGE 3)
     $topic = ZFDemoModel_Topics::getPresentationModelByTopicId($this->topicId);
     $this->view->topicName = $topic->topic_name;
     $this->view->hide = false;
 }
Exemplo n.º 2
0
 /**
  * STAGE 3:  Choose, create, and optionally update models using business logic.
  * STAGE 4.  Apply business logic to create a presentation model for the view.
  */
 protected function displayStage3_4()
 {
     // the posts and topics models auto-instantiate themselves, as needed (STAGE 3)
     $this->view->posts = ZFDemoModel_Posts::getPostsByTopicId($this->topicId);
     $this->view->topicId = $this->topicId;
     // the posts and topics models auto-instantiate themselves, as needed (STAGE 3)
     $topic = ZFDemoModel_Topics::getPresentationModelByTopicId($this->topicId);
     $this->view->topicName = $topic->topic_name;
     $this->view->hide = false;
     /////////////////////////////
     // ==> SECTION: acl <==
     $role = ZFModule_Forum::getRole();
     // another form of access control (whether or not to show hidden posts)
     $this->view->hide = $role === 'moderator' || $role === 'admin' ? false : true;
 }