diff --git a/.gitignore b/.gitignore index 3070064..8e5a570 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea vendor composer.lock -.env \ No newline at end of file +.env +.vscode \ No newline at end of file diff --git a/composer.json b/composer.json index ff794d0..12a7b15 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,6 @@ }, "require": { "vlucas/phpdotenv": "^5.0", - "thecodeholic/php-mvc-core": "^v1.0.4" + "thecodeholic/php-mvc-core": "^v1.0.5" } } diff --git a/controllers/SiteController.php b/controllers/SiteController.php index bb4ee04..fdb79b4 100644 --- a/controllers/SiteController.php +++ b/controllers/SiteController.php @@ -38,6 +38,9 @@ public function home() public function login(Request $request) { + echo '
'; + var_dump($request->getBody(), $request->getRouteParam('id')); + echo ''; $loginForm = new LoginForm(); if ($request->getMethod() === 'post') { $loginForm->loadData($request->getBody()); @@ -85,4 +88,11 @@ public function profile() { return $this->render('profile'); } -} \ No newline at end of file + + public function profileWithId(Request $request) + { + echo '
'; + var_dump($request->getBody()); + echo ''; + } +} diff --git a/docker-compose.yml b/docker-compose.yml index 8531289..8f1a64c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,9 @@ services: volumes: # Mount source-code for development - ./:/var/www + extra_hosts: + - host.docker.internal:host-gateway + db: image: mysql:8 ports: diff --git a/docker/Dockerfile b/docker/Dockerfile index 9740c1d..afe41e5 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -18,7 +18,8 @@ RUN apt-get update && \ # Install PHP Extensions RUN docker-php-ext-install zip pdo_mysql -# RUN pecl install -o -f xdebug-3.1.3 \ +RUN pecl install -o -f xdebug-3.1.5 \ + && docker-php-ext-enable xdebug # && rm -rf /tmp/pear # Copy composer installable diff --git a/docker/php.ini b/docker/php.ini index c6d1b76..dd15c37 100644 --- a/docker/php.ini +++ b/docker/php.ini @@ -1,3 +1,8 @@ ; General upload_max_filesize = 200M post_max_size = 220M + +[xdebug] +xdebug.mode = debug +xdebug.start_with_request = yes +xdebug.client_host = host.docker.internal \ No newline at end of file diff --git a/public/index.php b/public/index.php index 33d2be1..8572ddf 100644 --- a/public/index.php +++ b/public/index.php @@ -32,10 +32,19 @@ $app->router->get('/register', [SiteController::class, 'register']); $app->router->post('/register', [SiteController::class, 'register']); $app->router->get('/login', [SiteController::class, 'login']); +$app->router->get('/login/{id}', [SiteController::class, 'login']); $app->router->post('/login', [SiteController::class, 'login']); $app->router->get('/logout', [SiteController::class, 'logout']); $app->router->get('/contact', [SiteController::class, 'contact']); $app->router->get('/about', [AboutController::class, 'index']); $app->router->get('/profile', [SiteController::class, 'profile']); +$app->router->get('/profile/{id:\d+}/{username}', [SiteController::class, 'login']); +// /profile/{id} +// /profile/13 +// \/profile\/\w+ -$app->run(); \ No newline at end of file +// /profile/{id}/zura +// /profile/12/zura + +// /{id} +$app->run();