Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CB9TOIIIA/4ca54e85861bb0478653c12d38378641 to your computer and use it in GitHub Desktop.
Save CB9TOIIIA/4ca54e85861bb0478653c12d38378641 to your computer and use it in GitHub Desktop.
Обработка плагинами Joomla
https://docs.joomla.org/Supporting_plugins_in_your_component
Joomla 3.8+
// Process the content plugins.
PluginHelper::importPlugin('content');
$item->text = &$item->about;
$dispatcher->trigger('onContentPrepare', array('com_board.item', &$item, &$item->params, $offset));
Joomla 2.5+
http://jdevelop.info/articles/develop-joomla/220-obrabotka-dannykh-s-pomoshchyu-plaginov-joomla-2-5
$results = $dispatcher->trigger('onContentBeforeDisplay', array('com_content.article', &$item, &$this->params, $offset));
Если вы делаете свой компонент или модуль к Joomla, то вы можете использовать плагины для компонента com_content:
$obj = new stdClass;
$obj->text = $text;
JPluginHelper::importPlugin('content');
$dispatcher =& JDispatcher::getInstance();
$results = $dispatcher->trigger( 'onContentPrepare', array( 'com_filer.filer', &$obj, &$params, 0 ) );
echo $obj->text;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment