sandbox

Sandbox is an object holding properties and methods that will be available and persisted in both the standard and the ajax execution environments. 

Reference

Go to Top
path data type req def uobj description
extendsstring; file-path    The sandbox can extend an existing PHP class to inherit it's method and properties.
Provide the path in this format:
/path/to/class.mysandbox.php::mysandbox_classname

  1. <sandbox extends="EXT:my_extension/class.mysandbox.php::mysandbox" />

For tiny specializations, it's is also possible to define the php in a userobj.
  1. <sandbox>
  2. <userobj>
  3. <php><![CDATA[
  4.  
  5. var $bar = 0;
  6.  
  7. function foo() {
  8. $this->bar++;
  9. }
  10.  
  11. ]]></php>
  12. </userobj>
  13. </sandbox>

To access the sandbox in your application, use:
  1. $this->oSandBox->foo();


If the sandbox defines a init() method, it will be called by Formidable at initialization time.

Examples

Go to Top