Teraz mam klase Loader a dokladnie:
<?php require_once('libraries/Path.php'); class Loader { //public function __construct() {} 'Router', 'View', 'Cfg' ); require_once('libraries/'.$lib.'.php'); self::$libraries[$lib] = new $lib(); } return self::$libraries[$lib]; } } require_once('libraries/'.$lib.'.php'); return new $lib(); } } require_once('helpers/'.$helper.'.php'); } } require_once('widgets/'.$widget.'.php'); $widget = new $widget(); if($widget instanceof IWidget_Controller && method_exists($widget, 'Render')) { return $widget -> Render(); } return false; } return false; } } ?>
Jednak jak widac ma ona ustawione sciezki na sztywno, a w klasie Path mam sciezki generowane dynamicznie problem polega na tym ze jak stworze instanjce obiektu Path wewnatrz metody statycznej to nie zadziala.
Ma ktos pomysl jak moglbym to rozwiazac?
Probolwalem juz tworzyc instancje za pomoca statycznej metody jednak nie dziala chyba ze cos zle robie.
P.S to jest klasa Path:
<?php class Path { protected $cfg; public function __construct() { $this -> cfg = Loader::load('Cfg'); 'DIR_CTRL' => $this -> cfg -> PathControllers, 'DIR_MODELS' => $this -> cfg -> PathModels, 'DIR_VIEWS' => $this -> cfg -> PathViews, 'DIR_PLUGINS_CONFIG' => $this -> cfg -> PathPlugins.$this -> cfg -> PathConfig, 'DIR_PLUGINS_CTRL' => $this -> cfg -> PathPlugins.$this -> cfg -> PathControllers, 'DIR_PLUGINS_MODELS' => $this -> cfg -> PathPlugins.$this -> cfg -> PathModels, 'DIR_PLUGINS_VIEWS' => $this -> cfg -> PathPlugins.$this -> cfg -> PathViews, 'DIR_PLUGINS_FILTERS' => $this -> cfg -> PathPlugins.$this -> cfg -> PathFilters, 'DIR_COMPONENTS_CONFIG' => $this -> cfg -> PathModules.$this -> cfg -> PathConfig, 'DIR_COMPONENTS_CTRL' => $this -> cfg -> PathModules.$this -> cfg -> PathControllers, 'DIR_COMPONENTS_MODELS' => $this -> cfg -> PathModules.$this -> cfg -> PathModels, 'DIR_COMPONENTS_VIEWS' => $this -> cfg -> PathModules.$this -> cfg -> PathViews, 'DIR_WIDGETS_CTRL' => $this -> cfg -> PathWidgets.$this -> cfg -> PathControllers, 'DIR_LIBRARY' => $this -> cfg -> PathLibs, 'DIR_HELPERS' => $this -> cfg -> PathHelpers, 'DIR_LANG' => $this -> cfg -> PathLang, 'DIR_INTERFACES' => $this -> cfg -> PathInterfaces, 'DIR_CACHE' => $this -> cfg -> PathCache, 'DIR_CONFIG' => $this -> cfg -> PathConfig ); } public function get() { return $this -> path; } public function __get($key) { return false; } } ?>