Welcome Guest, Not a member yet? Register   Sign In
Access Class Variable inside another class
#1

[eluser]adamp1[/eluser]
I have the following setup
Code:
class Page extends Controller
{
  function Page()
  {
    $this->_variable = "something";
  }

  function index()
  {
    $this->Library->method();
  {
}

class Library
{
  function method()
  {
    // Use $_variable
  }
}

So is there a way the library can access the variable without it being passed explicitly to the class/method?


Messages In This Thread
Access Class Variable inside another class - by El Forum - 02-18-2008, 01:45 PM
Access Class Variable inside another class - by El Forum - 02-18-2008, 01:48 PM
Access Class Variable inside another class - by El Forum - 02-18-2008, 03:17 PM
Access Class Variable inside another class - by El Forum - 02-18-2008, 04:08 PM
Access Class Variable inside another class - by El Forum - 02-18-2008, 04:10 PM
Access Class Variable inside another class - by El Forum - 02-19-2008, 07:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB