Skip to content
Greg Bowler edited this page May 9, 2026 · 3 revisions
  • Define page logic as the entry point for one page request.
  • Position it as thin coordination code rather than the home of all business rules.

How logic pairs with a view

  • Explain filename pairing with the page view.
  • Explain what happens when there is no logic file.

Logic hooks

go functions

  • Introduce the go function.
  • The functions should not output anything directly - any output from echo or debug code will be sent to the browser's developer console.

do functions

  • Introduce do functions.
  • Explain the role of do_* methods for user actions.

Order of execution

  • Introduce go_before, `go_after.
  • Explain the order in which they all run.
  • Explain how nested _common logic will run in a particular order (from nested out, or the other way around, whatever it actually is).

What to do in page logic

  • Read input.
  • Call application classes or services.
  • Bind data to the document.
  • Set headers or response state.

What NOT to do in page logic

  • Large business rules.
  • Raw SQL manipulation code.
  • HTML in strings construction.
  • Reiterate that any output from echo or debug code will be sent to the browser's developer console.

Now the pages can have dynamic content, let's learn about dynamic URLs.

Clone this wiki locally