I am quite new to PHP but not to OO. Problem is that I am trying to create a class whose member variables depend on another class in which case I need to use require_once() in the class body. But the problem is that it is not working. Could somebody please tell me how I can use require_once() inside a class body? Here is my code:
here is a basic idea:
Code: Select all
<?php
class client
{
require_once('SOAP/Client.php'); //how can I make this one work?
var $conn = new SOAP_Wsdl("http://ws.wsdlservice.wsdl");
public $client ;
function __construct()
{
$client = $conn->getProxy();
}
function getClient()
{
return $client;
}
}
?>$client = new client();
$client = $client->getClient();
Please, tell me what I am doing wrong here, the process stops when I try to instantiate $conn variable using "new SOAP_WSDL()" but it must use this package.
Please help,
Thank you,
Victor.