Hello all.
I have been teaching myself PHP for a while now and am finally at a stage where I am trying to put together a web forum written from scratch in PHP. I have been reading the phpBB code to try and understand everything that it does so that I can include as much functionality in my own forum as possible (I don't want to just copy and paste though, I want to understand it).
I repeatedly keep running into a piece of code which appears to be calling a function from the template.php page, yet I don't understand why it works (I come from an ASP background, so it could just be a clash of understanding).
The function in includes/template.php:
How it is called in posting.php:
Could someone explain how this is calling the function, since it has $template on the front, and what the meaning of the '->' is?
Thanks
I have been teaching myself PHP for a while now and am finally at a stage where I am trying to put together a web forum written from scratch in PHP. I have been reading the phpBB code to try and understand everything that it does so that I can include as much functionality in my own forum as possible (I don't want to just copy and paste though, I want to understand it).
I repeatedly keep running into a piece of code which appears to be calling a function from the template.php page, yet I don't understand why it works (I come from an ASP background, so it could just be a clash of understanding).
The function in includes/template.php:
Code:
function set_filenames($filename_array)
{
if (!is_array($filename_array))
{
return false;
}
reset($filename_array);
while(list($handle, $filename) = each($filename_array))
{
$this->files[$handle] = $this->make_filename($filename);
}
return true;
}
Code:
[blue]$template->set_filenames[/blue](array(
'confirm_body' => 'confirm_body.tpl')
);
Thanks