ozone Posted July 21, 2009 Share Posted July 21, 2009 Hey again. I faced a problem again. Here we go.. : I have main class "core" in file site.php above in this file, is includes, of other future modules (articles, forums etc...) There are classes in included files. So I need somehow to extend main class "core" with other 5 or 10 classes in included files, so I can work properly... It is kind a CMS mini version for me. I tried - no good :-\ //including all classes in include folder foreach(glob("*.class.php") as $class_filename) { require_once($class_filename); } //main web site control and output class class website { function __construct(){ //get variables from link $pre_link = explode('//', $_SERVER['REDIRECT_URL']); $link = explode('/', $pre_link[1]); //remove .html from the end foreach ($link as $sub_link => $address){ $pat = "/html/i"; if(preg_match($pat, $address)){ $link[$sub_link] = str_replace('.html', '', $address); } //$link[0] = website.com //$link[1] = first_variable between "/".. //last variable most often index or link for SEO $link['last'] = $link[count($link)]; } //deside module of throw error } This is part of core.php file, where is constructor, at this time class contains no more functions... I need advice how to extend main class without calling extenders, becouse there will be 10 classes who extends main "core" class. Thanks in advance... Quote Link to comment https://forums.phpfreaks.com/topic/166846-need-extended-class-working-by-calling-itself-instead-of-extender-classes/ Share on other sites More sharing options...
trq Posted July 22, 2009 Share Posted July 22, 2009 Yep, that made no sense at all. Quote Link to comment https://forums.phpfreaks.com/topic/166846-need-extended-class-working-by-calling-itself-instead-of-extender-classes/#findComment-880046 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.