![]() |
![]() |
![]()
Post
#1
|
|
![]() Grupa: Zarejestrowani Postów: 544 Pomógł: 6 Dołączył: 21.07.2008 Ostrzeżenie: (0%) ![]() ![]() |
Witajcie,
miałem chwilę i usiadłem do autorskiego frameworka opartego na wzorcu MVC. Chciałbym go dopracować, utworzyć wersje stabilną. Kod frameworka jest dostępny pod adresem: https://github.com/artimman/dbmframework Zakończyłem pierwszy test aplikacji na serwerze zdalnym - powodzeniem. Wydaje się, że już jest całkiem Ok i ciekawe, czy ktoś się ze mną zgodzi? -------------------- I welcome you on the Internet >>> Design by Malina
|
|
|
![]() |
![]()
Post
#2
|
|
![]() Grupa: Zarejestrowani Postów: 544 Pomógł: 6 Dołączył: 21.07.2008 Ostrzeżenie: (0%) ![]() ![]() |
No, aż mi głupio, ale jeszcze nie mogę uwierzyć, że aby było ok trzeba wykonać aż takie przejście z pliku do pliku i plik po pliku.
Jest tak w pliku index.php // Routing and database connection use Dbm\Classes\Database; $database = new Database; $routes = require(BASE_DIRECTORY . 'application' . DS . 'routes.php'); $routes($database); routes.php return function (Database $database) { $uri = $_SERVER['REQUEST_URI']; $router = new Router($database); ... } class Router public function __construct(Database $database) { $this->database = $database; } if (class_exists($controller)) { $controllerInstance = new $controller($database); ... } AbstractController - nie jest abstract, więc nazwa do zmiany public function __construct(Database $database) { $this->database = $database; } IndexController public function __construct(Database $database) { $model = new BlogModel($database); $this->model = $model; $translation = new Translation(); $this->translation = $translation; } aż dochodzę do modelu BlogModel public function __construct(Database $database) { $this->database = $database; } Czy teraz jest Ok? -------------------- I welcome you on the Internet >>> Design by Malina
|
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 25.06.2024 - 12:34 |