Call to a member function on a non-object
- From: "aaron" <BackdoorBobby@xxxxxxxxx>
- Date: 26 Sep 2005 16:40:51 -0700
function sidebar($sbtitle,$sbmain,$sbfooter){
global $sbtitle, $sbmain, $sbfooter;
$template->set_filenames(array(
'sidebar' => 'sidebar.tpl')
);
$template->assign_vars(array( 'SBHEADER' => $sbheader,
'SBMAIN' => $sbmain,
'SBFOOTER' => $sbfooter
));
$template->pparse('sidebar');
}
sidebar('MYTITLE','MAIN','Footer');
What am I doing wrong here? I recieve the Call to a member function
error.
My main goal is to create a little side bar that can be called with the
three variables. So that when using a template engine on the main page
I can diplay several of these "sidebar" with different contents. This
is what I am working towards on the main PHP page so that I can just
have {LASTTHUMB} AND {LASTBLOG} where ever I want in the .tpl page
$template->set_filenames(array(
'body' => 'main_body.tpl')
);
$template->assign_vars(array( 'COLOR' => $my_color,
'LASTTHUMB' => sidebar('PhotoTitle',
'Myphoto','PhotoFooter'),
'LASTBLOG' =>
sidebar('BlogTitle','Blog','Blogfooter')
));
$template->pparse('body');
.
- Follow-Ups:
- Re: Call to a member function on a non-object
- From: Sander K
- Re: Call to a member function on a non-object
- From: Schraalhans Keukenmeester
- Re: Call to a member function on a non-object
- Prev by Date: Re: Opening page in other frame
- Next by Date: Not return a value
- Previous by thread: Opening page in other frame
- Next by thread: Re: Call to a member function on a non-object
- Index(es):