chcialbym zeby $user byla to klasa ktora po dostepie do niej np. (
$this->user=user::new();
) zaladowala model user i podmienila siebie... nie wiem czy sie jasno wyrazilem ale jestem po nie przespanej nocy
$this->user->name=''

chcialbym zeby $user byla to klasa ktora po dostepie do niej np. (
$this->user=user::new();
) zaladowala model user i podmienila siebie... nie wiem czy sie jasno wyrazilem ale jestem po nie przespanej nocy
$this->user->name=''
$this -> klasa -> metoda(); //etc.....
Jakoś nie specjalnie dużo kombinowania, a kod jest dużo czytelniejszy.
public function ...(){ $abc = new Abc(); $def = Def::getSth('dsd'); //i w abc, def masz dostęp do dwóch modeli }
class Autoloader{ public function __construct(){ $this->loadMaps(); } private function loadMaps(){ $current_mod_components_dir=APPPATH.'components/'; foreach(new DirectoryIterator($current_mod_components_dir ) as $v){ if(!$v->isDot() && $v->isDir()) $components_dir[]=$v->getPathname().'/config/maps'; } SYSPATH.'config/maps/', APPPATH.'config/maps/'); foreach($maps_dirs as $map_dir){ foreach(new DirectoryIterator($map_dir) as $map){ if(!$map->isDot() && !$map->isDir()){ include $map->getPathname(); } } } } public function load($class_name){ include self::$map[$class_name]; self::$included[]=$class_name; return self::$map[$class_name]; } else return false; } }
switch($args) { case 0: jakas_funkcja(); break; case 1: jakas_funkcja($argv[0]); break; case 2: jakas_funkcja($argv[1], $argv[2]); break; }