本文整理汇总了PHP中JApplication::triggerEvent方法的典型用法代码示例。如果您正苦于以下问题:PHP JApplication::triggerEvent方法的具体用法?PHP JApplication::triggerEvent怎么用?PHP JApplication::triggerEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JApplication
的用法示例。
在下文中一共展示了JApplication::triggerEvent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onContentAfterDisplay
/**
* @param string The context of the content being passed to the plugin.
* @param object The article object. Note $article->text is also available
* @param object The article params
* @param int The 'page' number
*
* @return void
* @since 1.1.0
*/
public function onContentAfterDisplay($context, &$row, &$params, $page = 0)
{
JPluginHelper::importPlugin('fieldsandfiltersextensions');
// Trigger the onFinderBeforeSave event.
$results = $this->app->triggerEvent('onFieldsandfiltersContentAfterDisplay', array($context, &$row, &$params, $page = 0));
return !empty($results) ? trim(implode("\n", $results)) : null;
}
示例2: _actionPrepclienv
/**
* Prepares the CLI mode.
*
* @param KCommandContext $context
*/
protected function _actionPrepclienv(KCommandContext $context)
{
if (!empty($_SERVER['argv']) && count($_SERVER['argv']) > 1) {
$args = array_slice($_SERVER['argv'], 1);
if (is_readable(realpath($args[0]))) {
$file = array_shift($args);
}
$args = explode('&-data&', implode($args, '&'));
$args = array_filter($args, 'trim');
foreach ($args as $i => $arg) {
$arg = trim($arg);
if ($i == 0) {
if (strpos($arg, '/') !== false) {
$arg = substr_replace($arg, '?', strpos($arg, '&'), 1);
$url = KService::get('koowa:http.url', array('url' => $arg));
KRequest::url()->path = KRequest::base() . $url->path;
$_GET = $url->query;
} else {
KRequest::url()->path = KRequest::base();
parse_str($arg, $_GET);
}
} else {
parse_str($arg, $_POST);
}
}
}
$_GET['format'] = 'json';
KRequest::url()->format = 'json';
KRequest::url()->setQuery($_GET);
jimport('joomla.plugin.helper');
JPluginHelper::importPlugin('cli');
$this->_application->triggerEvent('onCli');
//if there's a file then just load the file and exit
if (!empty($file)) {
KService::get('koowa:loader')->loadFile($file);
exit(0);
}
}