Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

call_user_func() bringt Fehlermeldung

Empfohlene Antworten

Veröffentlicht

Hallo!

ich habe folgendes Problem. Ich schreibe gerade "eine Art" vereinfachtes Eventhandling in PHP. Dabei werden funktionen an einen Eventnamen z.B. "CORE_RENDER_CONSOLE" gebunden und an entsprechender Stelle ausgeführt. Die Funktionen werden zuvor in einem string in dieser Form gespeichert: "Core::\$core->modules->getModule('logconsole')->renderGui()"

aufgerufen wird dann:

call_user_func("Core::\$core->modules->getModule('logconsole')->renderGui()");

... in diesem Fall ohne Parameter. Nun bekomme ich folgende Fehlermeldung:

Warning: call_user_func("Core::\$core->modules->getModule('logconsole')->renderGui()") [function.call-user-func]: First argument is expected to be a valid callback in D:\htdocs\modules\core\classes\class.hook.php on line 21

Kann mir jemand helfen? Oder hat jemand ne Alternativmöglichkeit?

Grüße oliver

also wenn ich das richtig verstehe willst du aus der classe core "modules->getModule('logconsole')->renderGui()" aufrufen?

wenn dem so is..

aus den comments:

For calling a class method from version 5.2.3 you can write

<?php

class myclass {

static function say_hello()

{

echo "Hello!\n";

}

}

$classname = "myclass";

call_user_func('myclass::say_hello');

?>

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.