0

Good day.

I have this code to make a popup message.

public function transactionMessage($message = 'Some message')
{
    $this->getResponse()->getHeaders()->addHeaderLine('Content-type', 'text/json');

    $view = new JsonModel();
    $view->setTerminal(true);
    $view->setVariable('message', $message);
    $view->setVariable('result', true);
    return $view;
}

How can I have multiple messages? Something like this...

$view->setVariable('message', $message);
$view->setVariable('message2', $message);

Any type of help will do!

yowza
  • 260
  • 2
  • 14
  • 1
    It's not exactly clear what you want to achieve. If you want to provide `transactionMessage()` with an array of messages, you can just change the `$message` parameter into an array (and remove the default value) – Pieter Jun 02 '16 at 11:58
  • Thank you for mentioning `array`! An array of messages is what I needed! – yowza Jun 02 '16 at 12:05

0 Answers0