7.1. Opt_Class class
7.1.10. setup()
7.1.9. setTranslationInterface()
« Previous
7.2. Opt_View class
Next »

7.1.10. setup()

ConstructMethod
Visibilitypublic
Referencevoid setup([mixed $config])
Argument list
$config - mixed
The library configuration to be loaded on setup
Versionssince 2.0-dev7

Performs the main initialization of OPT. If the optional argument $config is specified, it is transparently sent to Opt_Class::loadConfig(). Before using this method, we are obligated to configure the library and load the necessary extensions.

$tpl = new Opt_Class;
$tpl->sourceDir = './templates/';
$tpl->compileDir = './templates_c/';
$tpl->setup();
 
$view = new Opt_View('template.tpl');
$view->foo = 'bar';
 
$out = new Opt_Output_Http;
$out->render($view);

You must not render the views before using Opt_Class::setup(). This may cause an unexpected behavior.

See also:

7.1.10. setup()
7.1. Opt_Class class
« Previous
7.1.9. setTranslationInterface()
Next »
7.2. Opt_View class