code: public function display($type = 'all', $print = false)
      {
          $messages = '';
          $data = '';
  
  
          if (in_array($type, $this->msgTypes)) {
              // Print a certain type of message?
  
              $flashMessages = $this->driver->get('flash_messages');
              foreach ($flashMessages[$type] as $msg) {
                  $messages .= $msg;
              }
  
              $data .= $messages;
  
              // Clear the viewed messages
              $this->clear($type);
          } elseif ($type === 'all') {
  
              // Print ALL queued messages
              $flashMessages = $this->driver->get('flash_messages');
              foreach ($flashMessages as $type => $msgArray) {
                  $messages = '';
                  foreach ($msgArray as $msg) {
                      $messages .= $msg;
                  }
                  $data .= $messages;
              }
  
              // Clear ALL of the messages
              $this->clear();
          } else {
  
              // Invalid Message Type?
              return false;
          }
  
          // Print everything to the screen or return the data
          if ($print) {
              echo $data;
              return null;
          }
  
          return $data;
      }
docs: Display the queued messages.
  
  @param string $type  Which messages to display
  @param bool   $print True print the messages on the screen
  
  @return mixed