Layouts

Layouts And Partials

Layouts work well with partials because layouts own the shared page shell.

Shared Pieces#

Put repeated pieces like headers and footers in partials:

phpresources/views/layouts/default.php
<!doctype html><html><body>  <div id="page">    <Header />    {{ slot }}    <Footer />  </div></body></html>

This keeps repeated navigation, branding, and footer markup in one place.

Keep Layouts Small#

A useful pattern is:

  • Layouts own the document shell.
  • Partials own reusable pieces.
  • Page templates own page-specific content.

Read Partials for the full partial syntax.