Type of Flash Messenger in Zend

后端 未结 4 545
遥遥无期
遥遥无期 2021-02-02 15:25

Is it possible or How can i give a type to a FlashMessage in Zend?

For example

/* This is a \"Success\" message */
$this -> _helper -> FlashMesseng         


        
4条回答
  •  温柔的废话
    2021-02-02 15:48

    It is possible. Sample implementation in described in this blog post:

    • Zend Framework: View Helper Priority Messenger | emanaton

    Excerpt:

    class AuthController extends Zend_Controller_Action {
      function loginAction() {
        . . .
        if ($this->_request->isPost()) {
          $formData = $this->_request->getPost();
          if ($this->view->form->isValid($formData)) {
            . . .
          } else {
            $this->view->priorityMessenger('Login failed.', 'error');
          }
        . . .
      }
    }
    

提交回复
热议问题