Give every Books page the same identity.
- Create head, header, footer, and book-form partials.
- Store pages under src/views/books.
- Create public/css/app.css and public/img/logo.svg.
- Add clear keyboard navigation and metadata.
- Customize 404.php and default.php.
Shared header
src/views/partials/header.php
<header>
<nav class="container" aria-label="Main navigation">
<a class="brand" href="/books">
<img src="/img/logo.svg" width="32" height="32" alt="">
<span>Reading List</span>
</a>
<a href="/books">Books</a>
<a href="/books/create">Add</a>
<a href="/about">About</a>
</nav>
</header>Shared footer
src/views/partials/footer.php
<footer>
<div class="container">
<small>© <?= date('Y') ?> Reading List</small>
</div>
</footer>Safe migration order
- Create partials without removing old HTML.
- Migrate only books/index.php and reload /books.
- Migrate create.php, then test a valid and invalid addition.
- Migrate edit.php, then test update and deletion.
- Add CSS and images after confirming the HTML.
This progression avoids changing structure, style, and behavior simultaneously. If an error appears, the last small step probably identifies its cause.
Final checklist
Every page has one unique h1✓
Tab reaches every control✓
Errors remain near fields✓
Values are escaped✓
An unknown URL shows 404✓
No src file is public✓
aml test
# puis vérifier /books, /books/create et une URL inconnueSUMMARY
What to remember
- partial() explicitly composes classic views.
- src/views stays private; public is served to the browser.
- Semantic HTML comes before CSS decoration.
- JavaScript enhances but does not replace the server.
- Public error pages expose no internal detail.