Location: PHPKode > scripts > PHP Voice > php-voice/modules.readme.txt
How to create modules for the PHP voice Classes

Modules are classes that can extends functionnalities of the PHP voice package.

Module file should have the same name as the module class itself for example :

vxml_mods/sample.class.php

<?php

class sample
{
 	/**
 	* @access private
 	* @var object
 	*/
	var $obj;

 	/**
 	* Class constructor
 	*/
 	function sample(&$obj){
 		$this->obj = &$obj;
 	}

 	/**
 	* Class constructor
 	*/
 	function method($params){
		// export $params here
		$field_name = $params[0];
		$this->obj->start_field($field_name);
		$this->obj->end_field();
 	}
}

?>


Then you can call this modules :

<?php


require_once('vxml.class.php');

$field_name = "test";

$page = new gonx_vxml;
$page->start_vxml("", "", "", "", "", "2.0");
$page->load("sample::method",array($field_name));
$page->end_vxml();

?>

Let me know if you have comments or idea to extend this feature.

Hatem <hide@address.com>
Return current item: PHP Voice