Last active
August 29, 2015 14:02
-
-
Save Codenator81/3ec9e6a80d53346b3207 to your computer and use it in GitHub Desktop.
testClass
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
// class | |
<?php | |
global $modx; | |
class Webdev extends xPDOSimpleObject { | |
function __construct(modX &$modx) { | |
$this->modx =& $modx; | |
} | |
function runAsFunction($name,$params = []){ | |
global $modx; | |
if($s = $modx->getObject('modSnippet', [ | |
'name' => $name, | |
])){ | |
$s->loadScript(); | |
$f = $s->getScriptName(); | |
// $params = array('foo' => $foo); | |
$func = $f($params); | |
return $func; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment