Joomla content management system, has different ways to call a plugin in components. This post covers the brief mechanism of Joomla plugin and how to call them in Joomla components.
In Joomla CMS, a plugin is not called the usual way. It is mostly triggered by events. Each time the event is triggered, the corresponding plugin is called. To call Joomla plugin in component each time, it must be triggered by one of the global system events. It is the safest way to call Joomla plugin in Joomla.
You can also call the Joomla plugin in Component with the help of non-global system events. But in such cases, you have to explicitly add the event to each component for which the plugin is used.
$dispatcher = JDispatcher::getInstance(); $data = array($argu1, $argu2); // any number of arguments you want return $dispatcher->trigger($eventName, $data);
$text = JHTML::_('content.prepare', $text);