-
-
Notifications
You must be signed in to change notification settings - Fork 81
Getting started #283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting started #283
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the "Getting started" guide with improvements to code formatting, documentation paths, and significant enhancements to the database tutorial. The changes span multiple language versions (English, Russian, Indonesian, Spanish) and include translation file updates.
Key Changes
- Reformatted PHP attribute placement for better readability (moving
#[RouteArgument]to separate lines) - Fixed documentation links to use correct relative paths
- Added comprehensive database CRUD tutorial with complete action implementations
- Improved Docker setup instructions with ownership fix and composer update step
- Updated HTTP status code examples with detailed explanations
- Fixed code syntax (added
declare(strict_types=1), correctedReference::to()usage, addedshfence block annotations)
Reviewed changes
Copilot reviewed 53 out of 53 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| src/guide/start/databases.md | Major expansion with complete CRUD implementation, improved migration examples, and HTTP status code table |
| src/guide/start/creating-project.md | Added shell syntax highlighting, fixed Docker instructions with chown command |
| src/guide/start/forms.md | Added strict types declaration |
| src/guide/runtime/response.md | Added HTTP status code comparison table and improved JSON example |
| src/ru/guide/start/databases.md | Translation update (has inconsistencies with English version) |
| src/id/guide/start/databases.md | Translation update (has inconsistencies with English version) |
| src/es/guide/start/databases.md | Translation update (has inconsistencies with English version) |
| src/*/guide/views/view.md | Improved attribute formatting across all languages |
| src/*/guide/views/template-engines.md | Fixed renderer configuration and Markdown capitalization across all languages |
| src/*/guide/start/hello.md | Improved attribute formatting across all languages |
| src/*/guide/start/creating-project.md | Fixed documentation paths and Docker instructions across all languages |
| _translations/pot/* | Updated translation templates with new content |
| _translations/po/* | Updated translation files for all languages |
| <?= Html::a('Edit', $urlGenerator->generate('page/edit', ['slug' => $page->getSlug()])) ?> | | ||
| <?php |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing RouteArgument attribute on the $slug parameter. The English version at src/guide/start/databases.md:530-531 includes the #[RouteArgument('slug')] attribute on the parameter. Without this attribute, the routing system won't properly bind the URL parameter to this method argument.
| { | ||
| return $this->viewRenderer->render(__DIR__ . '/list', [ | ||
| 'pages' => $this->pageRepository->findAll(), | ||
| ]); |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect variable reference in template. The template uses $this->urlGenerator but the UrlGeneratorInterface variable should be accessed as $urlGenerator (without $this->). The English version at src/guide/start/databases.md:411 documents $urlGenerator as a template variable and uses it correctly at line 417. The view should either have this variable passed from the action or document it as an available view context variable.
| { | ||
| return $this->viewRenderer->render(__DIR__ . '/list', [ | ||
| 'pages' => $this->pageRepository->findAll(), | ||
| ]); |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect variable reference in template. The template uses $this->urlGenerator but the UrlGeneratorInterface variable should be accessed as $urlGenerator (without $this->). The English version at src/guide/start/databases.md:411 documents $urlGenerator as a template variable and uses it correctly at line 417. The view should either have this variable passed from the action or document it as an available view context variable.
| namespace App\Web\Page; | ||
| use Psr\Http\Message\ResponseFactoryInterface; |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Page entity no longer has an isDeleted() method. In the English version of this file, the deletedAt field was removed from the Page entity, and the check here was simplified to only check if the page is null. This condition should be: if ($page === null) to match the English version at src/guide/start/databases.md:455.
| namespace App\Web\Page; | ||
| use Psr\Http\Message\ResponseFactoryInterface; |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Page entity no longer has an isDeleted() method. In the English version of this file, the deletedAt field was removed from the Page entity, and the check here was simplified to only check if the page is null. This condition should be: if ($page === null) to match the English version at src/guide/start/databases.md:455.
| <?= Html::a('Edit', $urlGenerator->generate('page/edit', ['slug' => $page->getSlug()])) ?> | | ||
| <?php |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing RouteArgument attribute on the $slug parameter. The English version at src/guide/start/databases.md:530-531 includes the #[RouteArgument('slug')] attribute on the parameter. Without this attribute, the routing system won't properly bind the URL parameter to this method argument.
| <?= Html::a('Edit', $urlGenerator->generate('page/edit', ['slug' => $page->getSlug()])) ?> | | ||
| <?php |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing RouteArgument attribute on the $slug parameter. The English version at src/guide/start/databases.md:530-531 includes the #[RouteArgument('slug')] attribute on the parameter. Without this attribute, the routing system won't properly bind the URL parameter to this method argument.
| { | ||
| return $this->viewRenderer->render(__DIR__ . '/list', [ | ||
| 'pages' => $this->pageRepository->findAll(), | ||
| ]); |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect property access. The code uses $page->slug but the Page entity doesn't have a public slug property. Instead, use the $page->getSlug() method which generates the slug from the title. The English version at src/guide/start/databases.md:417 correctly calls $page->getSlug().
| { | ||
| return $this->viewRenderer->render(__DIR__ . '/list', [ | ||
| 'pages' => $this->pageRepository->findAll(), | ||
| ]); |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect property access. The code uses $page->slug but the Page entity doesn't have a public slug property. Instead, use the $page->getSlug() method which generates the slug from the title. The English version at src/guide/start/databases.md:417 correctly calls $page->getSlug().
| <?= Html::a('Create', $urlGenerator->generate('page/edit', ['slug' => 'new'])) ?> | ||
| ``` | ||
|
|
||
| ### View a page |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing trailing comma after the last constructor parameter. The English version at src/guide/start/databases.md:447 includes a trailing comma. For consistency and to match PHP best practices (especially with readonly properties), add a comma after $responseFactory.
No description provided.