7. API Reference
7.1. Opt_Class class
7. API Reference
« Previous
7.1.1. getBufferState()
Next »

7.1. Opt_Class class

Table of Contents

ConstructClass

This is the main class of Open Power Template. It provides the configuration, plugin support and initialization issues. You need only one object of this class in your script. Below, a sample initialization is shown:

$tpl = new Opt_Class;
// Load part of the configuration from the external INI file
$tpl->loadConfig('./someconfig.ini');
 
// Configure the paths
$tpl->sourceDir = './templates/';
$tpl->compileDir = './templates_c/';
 
// Register new add-ons
$tpl->register(Opt_Class::OPT_COMPONENT, 'opt:myComponent', 'My_Component_Class');
 
// Perform the initialization
$tpl->setup();

Now we can create Opt_View objects and parse the templates.

Do not forget to call Opt_Class::setup() method.

7.1. Opt_Class class
7. API Reference
« Previous
7. API Reference
Next »
7.1.1. getBufferState()