-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Orm load order changed, added Caller for twig
- Loading branch information
1 parent
2a5f04b
commit d54e3ee
Showing
3 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
namespace Tina4; | ||
class Caller { | ||
/** | ||
* Method to call classes using twig | ||
* Example in twig {{ Tina4.call ("Class", "Method", "Params") }} | ||
* @param $class | ||
* @param string $method | ||
* @param array $params | ||
* @return string | ||
*/ | ||
function call ($class, $method="", $params=[]) { | ||
eval ('$class = new '.$class.'();'); | ||
$object = [$class, $method]; | ||
$result = call_user_func_array($object, $params); | ||
|
||
return $result.""; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters