stupid OOP
Posted: Sat Mar 18, 2006 4:19 pm
HI all. I'm realy stuck on this, yet another illogical opp thingy...
I have created a set of objects needed to control my site in index.php, one called configObj which has all the config methods
and one called $secObj which holds some simple security methods,
My problem is how can I acces the meathods within the secObj from a meathod in the configObj, without creating another instance secObj
index.php
configObj, method, how i'm trying to do ot at the moment
secObj method i'm trying to use (simplyfied)
ps, does it matter that $this->dbHost is a private var withinthe config class?
I have created a set of objects needed to control my site in index.php, one called configObj which has all the config methods
and one called $secObj which holds some simple security methods,
My problem is how can I acces the meathods within the secObj from a meathod in the configObj, without creating another instance secObj
index.php
Code: Select all
// create new security object
$secObj = new security();
// create a new config object
$configObj = new config();Code: Select all
$this->dbPass = $secObj->encrypt($this->dbPass);
$this->dbUser = $secObj->encrypt($this->dbUser);
$this->dbHost = $secObj->encrypt($this->dbHost);
$this->dbName = $secObj->encrypt($this->dbName);Code: Select all
function encrypt($string){
$out = "encrypeted: ".$string;
return $out;
}