Function call_helper
Receives a string and tries to figure it out if its a method or a function. If a method is found, it looks for a "#" which indicates SMF should create a new instance of the given class. Checks the string/array for is_callable() and return false/fatal_lang_error is the given value results in a non callable string/array. Prepare and returns a callable depending on the type of method/function found.
Package: SMF
Copyright: 2020 Simple Machines and individual contributors
License: BSD
Author: Simple Machines https://www.simplemachines.org
Located at Sources/Subs.php
Copyright: 2020 Simple Machines and individual contributors
License: BSD
Author: Simple Machines https://www.simplemachines.org
Located at Sources/Subs.php
mixed |
$string |
The string containing a function name or a static call. The function can also accept a closure, object or a callable array (object/class, valid_callable) |
boolean |
$return = false |
If true, the function will not call the function/method but instead will return the formatted string. |
string|array|boolean
|
Either a string or an array that contains a callable function name or an array with a class and method to call. Boolean false if the given string cannot produce a callable var. |