I need to display a green highlighted message in my grid.

I'm currently using <span class="label label-success">message</span>

Is there any way to do it via code like JFactory::getApplication()->enqueueMessage('Message'); but for displaying a label/badge instead?

  • 1
    Have you tried this JFactory::getApplication()->enqueueMessage('<span style="label label-success">' . $your-message . '</span>', 'message'). You may be able to leave out the second argument message i'm not sure?
    – jonboy
    Apr 1 '20 at 15:48
  • Thank you but i was looking for something that does it directly. Something like JFactory::getApplication()->enqueueBadge('danger'); Apr 2 '20 at 15:35
  • 1
    I'm not sure what you mean? Could you not assign the span html to a php variable then use this variable in the enqueMessage?
    – jonboy
    Apr 2 '20 at 15:42
  • Yeah. It's ok i will just use the span html without enqueMessage. Thank you @jonboy Apr 2 '20 at 15:47
  • 1
    Let us know if if works and we can add an answer for others
    – jonboy
    Apr 2 '20 at 16:01

Your Answer

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

Browse other questions tagged or ask your own question.