Jump to content


Photo

Using a class within another class


  • Please log in to reply
3 replies to this topic

#1 kickassamd

kickassamd
  • Members
  • PipPipPip
  • Advanced Member
  • 102 posts
  • LocationDallas Tx

Posted 14 June 2006 - 07:11 AM

I cant get this to work.... (I can extend the class from the other....but why...shouldnt have to)

Class 1 is the Smarty() Template Engine
Class 2 is my system class for redirecting users, processing user logins...etc etc.

Thing is im trying to use the smarty class within my system for this

public function redirect_header($url,$time,$message)
{
// Set Smarty Variables
Smarty::assign('redirect_url',$url);
Smarty::assign('redirect_time',$time);
Smarty::assign('redirect_notice',$message);
// Display Redirect Page...
Smarty::display('redirect_page.tpl');
}

it works just fine...until i use the display function then i get this error

Fatal error: Call to undefined method core_system_factory::fetch() in c:\Inetpub\wwwroot\classes\smarty\Smarty.class.php on line 1108.

I dont understand why it doesnt work.... fetch() is a smarty function not mine...so why is it looking in my class for it....

So my true question is how can i use a class function from another class within a class... with extending my system class from Smarty....

#2 joquius

joquius
  • Members
  • PipPipPip
  • Advanced Member
  • 319 posts

Posted 14 June 2006 - 07:52 AM

the Smarty object refers to it and you have called the Smarty object. check what's going on on line 1108 in the smarty class file
z..z..z..z..z..z..z..z..

#3 kickassamd

kickassamd
  • Members
  • PipPipPip
  • Advanced Member
  • 102 posts
  • LocationDallas Tx

Posted 14 June 2006 - 07:59 AM

[!--quoteo(post=383664:date=Jun 14 2006, 02:52 AM:name=joquius)--][div class=\'quotetop\']QUOTE(joquius @ Jun 14 2006, 02:52 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
the Smarty object refers to it and you have called the Smarty object. check what's going on on line 1108 in the smarty class file
[/quote]


Smarty works just fine...just not when im trying to use it within another class...

#4 kickassamd

kickassamd
  • Members
  • PipPipPip
  • Advanced Member
  • 102 posts
  • LocationDallas Tx

Posted 14 June 2006 - 08:40 AM

Solved :) Got it thanks!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users