Thx a lot, after spendin about 2-3 hours testing all these i ve figured out the same you have written =)
Some more tests and i ll understand this model by 80 percents =)
well i think i got the last question... as i’m stuck here.
class mytest {
public $modx;
public $mycore,$mymanager;
function __construct(&$modx,$mycore,$mymanager) {
$this->modx =& $modx;
$mycore = $this->modx->getOption('core_path').'components';
$mymanager = $this->modx->getOption('manager_url').'components';
//echo $mycore.'</br>';
}
}
So in construct i make a link to modx class. If uncomment the echo line? on class init i got the exact place of the core files, everything works fine.
In my tests i initialized with include and loadClass, so i ll show loadclass instance.
$modx->loadClass('mytest',$modx->getOption('core_path').'components/mycomp/class',false,true);
$modxx = new mytest(&$modx);
echo $modxx->manger.'</br>';
echo $modxx->mycore.'</br>';
so in my call i do the same thing as getService => reference to main xPDO class ($modx)
so after all i get full way to my core (even including drive letter of my local server) in the 1st line
in the second i dont get the full way although it is just ’components’
int the 3d ’manager/components’
why such a difference?