The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
I'd like to call a Class inside a Class
PHP Code:
|
|
#2
|
|||
|
|||
|
Is this any good for you http://stackoverflow.com/questions/4...m-inside-class
|
|
#3
|
|||
|
|||
|
thx but not realy
it's for c and not php |
|
#4
|
||||
|
||||
|
You'll have to write wrapper functions. You can't directly access the nested classes from outside, so wrapper functions will let you do that.
Code:
outer_class()
{
inner_class()
{
//...
$inner_variable = 'inside';
}
$g = new inner_class();
function access_inner_class_var()
{
return $g->inner_variable;
}
}
$z = new outer_class();
[S]$failed = $z->$g->inner_variable;[/S]
$success = $z->access_inner_class_var();
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|