Page 1 of 1

Newb Warning : question on functions and variables

Posted: Mon Jun 21, 2004 5:02 pm
by WizyWyg
I need to re-write a function, but I can't find anything on basic PHP that explains this (i've never had to use itbefore so I dont know what to call it)

Code: Select all

function load_file($filename, $sName)
     {
         $nName = "";
         $template_path = $this->templates_root . "/" . $filename;
         if (file_exists($template_path))
           {
             $this->DBlocks[$sName] = join('',file($template_path));
             $nName = $this->NextDBlockName($sName);
             while($nName != "")
             {
               $this->SetBlock($sName, $nName);
               $nName = $this->NextDBlockName($sName);
              }
           }
      }
So the code above, what does $this-> mean?
I've seen variables set up as $blah = "value"; but what does the "->" signify?

And links to online resources that explain this would be helpful


feyd|please use

Code: Select all

tags for posting code.[/color]

Posted: Mon Jun 21, 2004 5:05 pm
by markl999
Have a read of http://php.net/oop see if that clears some of it up for you.

Posted: Mon Jun 21, 2004 5:12 pm
by WizyWyg
Thanks it explains a little. I mtrying to change a function (the above) to pull a template from the DB instead of using STatic HTML pages . Im trying to figure out how to change the functions (there are about 10 of them) to accept the "coding" from the DB but parse it as if it was from the static. html pages. Will probably be back if i run int oproblems.