Version: v0.6.0 - Beta.  We welcome contributors & feedback.  THanks!

PHP Interface

Overview 

THT has basic support for calling PHP libraries via the Php module.

PHP Files 

Accessible PHP files should be located in app/misc/php.

They can be executed via Php.require, which uses PHP's require_once function.

// Load 'app/misc/php/myPhpLibrary.php'
Php.require('myPhpLibrary.php');

// Call a global function
$val = Php.call('a_php_function', 'arg1', 'arg2');

// Construct a PHP object
// Namespaces can use '/' instead of '\'
$obj = Php.new('Abc/MyClass');

$obj.someMethod();

See Also