PAGE Methods
Including templates and objects
content(), module(), object()Request content via AJAX
collect(), complete(), elements(), element()Insert code (CSS, JS, HTML)
style(), script(), meta(), bottom(), tracking()Template data
directory(), views(), details(), preview(), charset(), language(), error()Reading and writing META data
title(), topic(), descr(), claim(), robots(), keywords()HTTP header
mime(), status(), expires(), header(), download()
object()
Creates in instance of one of your own objects. If the class definition is placed in the template's incl/ folder, no directory needs to be passed. Your object will automatically receive the system's API object, so you can use the API inside your object. In order to achieve this make sure your object is build in the same manner as the example below. The filename of our example object is class_test.php.
1234567891011121314151617181920212223class test_obj{
private $data;
private $call;
private $user;
private $navi;
private $page;
private $form;
private $para;
public function __construct(&$EXEC, $parameters = array()){
$this->data = $EXEC->data;
$this->user = $EXEC->user;
$this->navi = $EXEC->navi;
$this->page = $EXEC->page;
$this->form = $EXEC->form;
$this->file = $EXEC->file;
$this->para = $parameters;
}
public function test($test){return $test;}
}
object object( string file )
Return
Object's instance
Parameter
Description
fileThe filename of your class definition.
Create object's instance
$TEST = $PAGE->object("class_test")
RETURN: [OBJECT]
Use object's instance in template code
$TEST->test("it works!")
RETURN: 'it works!'
Use object from different directory
$TEST = $PAGE->object($PAGE->directory('class_keys.php', 3, 1))
RETURN: [OBJECT]