Based on this question:. https://joomla.stackexchange.com/a/24042/8968

I want to add the return code as a message after save to see if it was successful or not.

Can someone tell how I can do this?

Here is my Code:

class plgContentBk_onsave extends JPlugin

public function onContentAfterSave ($context, $article, $isNew)
// Do something
[Send a message after save]
return true;    
  • Please write your snippet from the other page directly here so that future researchers don't have to page jump to get the full story.
    – mickmackusa
    Jan 11, 2019 at 11:30
  • stackoverflow.com/a/21741288/2943403
    – mickmackusa
    Jan 11, 2019 at 12:13
  • Please undelete your most recent question. By sharing your experience, other Joomla users can benefit. The right thing to do is to post a complete and educational answer to your own question.
    – mickmackusa
    Jan 11, 2019 at 14:56

1 Answer 1

$this->app->enqueueMessage($message, $type);

Where $message is the message string and $type is an optional type (message, warning, error or notice; defaults to message).

  • Thx: $application->enqueueMessage(JText::_($message), 'notice'); works for me
    – Lovntola
    Jan 11, 2019 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.