Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help please
#1
https://subversion.assembla.com/svn/open_cms/

Check that out with svn then look at the code, why isn't the $sanitizer object available in the User and Session classes? I'm curious when they should have inherited control through the config file.

Please help Sad
Reply
#2
To use a Class from inside another class you need to declare the class you want to use as global inside the function you want to use it in.

So say i have:

class lulz
{
public function lolz($lol)
{
return $lol;
}
}

class rofl
{
public function roflz($lul)
{
return $lul;
}
}

to call $lulz->lolz inside of roflz I would do this:

class rofl
{
public function roflz($lul)
{
global $lulz
$lul = $lulz->lolz;
return $lul;
}
}
Need website or forum help?
[Image: logo.png]
Reply
#3
Very interesting... I will help if you need PM me.
Reply
#4
(06-13-2011, 08:10 PM)0xE9 Wrote: To use a Class from inside another class you need to declare the class you want to use as global inside the function you want to use it in.

So say i have:

class lulz
{
public function lolz($lol)
{
return $lol;
}
}

class rofl
{
public function roflz($lul)
{
return $lul;
}
}

to call $lulz->lolz inside of roflz I would do this:

class rofl
{
public function roflz($lul)
{
global $lulz
$lul = $lulz->lolz;
return $lul;
}
}

Wow, maybe if you didn't name it so idiotically...
Reply
#5
(06-14-2011, 11:22 AM)๖ۣۜMitchell Wrote: Wow, maybe if you didn't name it so idiotically...
Next time I won't help you :\
Need website or forum help?
[Image: logo.png]
Reply
#6
(06-14-2011, 11:22 AM)๖ۣۜMitchell Wrote: Wow, maybe if you didn't name it so idiotically...


Name it yourself derp Unsure

Itleast he took the time to help u so why are u complaining?
Reply
#7
(06-14-2011, 02:08 PM)ILOVEW33D™ Wrote: Name it yourself derp Unsure

Itleast he took the time to help u so why are u complaining?

Because he didn't help me? Most of that is wrong wrong wrong.
Reply
#8
(06-15-2011, 08:01 PM)๖ۣۜMitchell Wrote: Because he didn't help me? Most of that is wrong wrong wrong.


How about u use yahoo answer's? that usually helps if SF cant help u.
Reply
#9
(06-15-2011, 08:01 PM)๖ۣۜMitchell Wrote: Because he didn't help me? Most of that is wrong wrong wrong.
What I explained was 100% correct. Did you even try and global it? -.- I use it on my website to use classes from within another. If it doesn't work for you maybe you should go back to learning.

This is a function I was testing, It makes calls to my sql class ($db) from withing the class $security and works fine.
[Image: 1308213843-clip-21kb.png]
Need website or forum help?
[Image: logo.png]
Reply
#10
i just googls stuff like this
Superman
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)