Files
opensourcepos/app/Helpers/plugin_helper.php
objec 962407b3f6 Review suggestion corrections
- Remove unused function
- reorder parameters in log(), logTo() and log_plugin_message()

Signed-off-by: objec <objecttothis@gmail.com>
2026-06-12 11:16:58 +04:00

27 lines
703 B
PHP

<?php
use CodeIgniter\Events\Events;
if (!function_exists('log_plugin_message')) {
function log_plugin_message(string $level, string $message, string $pluginId, ?string $logName = null): void
{
service('pluginLogger')->log($level, $message, $pluginId, $logName);
}
}
if (!function_exists('pluginContent')) {
function pluginContent(string $section, array $data = []): string
{
ob_start();
Events::trigger("view:{$section}", $data);
return ob_get_clean() ?: '';
}
}
if (!function_exists('pluginContentExists')) {
function pluginContentExists(string $section): bool
{
return !empty(Events::listeners("view:{$section}"));
}
}