kickassamd Posted June 14, 2006 Share Posted June 14, 2006 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 EngineClass 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 errorFatal 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.... Quote Link to comment https://forums.phpfreaks.com/topic/11955-using-a-class-within-another-class/ Share on other sites More sharing options...
joquius Posted June 14, 2006 Share Posted June 14, 2006 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 Link to comment https://forums.phpfreaks.com/topic/11955-using-a-class-within-another-class/#findComment-45405 Share on other sites More sharing options...
kickassamd Posted June 14, 2006 Author Share Posted June 14, 2006 [!--quoteo(post=383664:date=Jun 14 2006, 02:52 AM:name=joquius)--][div class=\'quotetop\']QUOTE(joquius @ Jun 14 2006, 02:52 AM) [snapback]383664[/snapback][/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... Quote Link to comment https://forums.phpfreaks.com/topic/11955-using-a-class-within-another-class/#findComment-45407 Share on other sites More sharing options...
kickassamd Posted June 14, 2006 Author Share Posted June 14, 2006 Solved :) Got it thanks! Quote Link to comment https://forums.phpfreaks.com/topic/11955-using-a-class-within-another-class/#findComment-45414 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.