ZF2 Demo

Welcome to the hotel demo app! This application demonstrates ZF2 basics.

Route Reference

URL Route Name Route Type Concepts
/room room Literal (parent, may_terminate) ViewModel, URL generation
/room/detail/3 room/detail Segment (child, constraint: [0-9]+) Route params, 404 handling
/room/detail/99 room/detail Segment Not-found handling (valid route, missing data)
/room/detail/abc No match (fails constraint) ZF2 404 — "abc" is not [0-9]+
/room/search?type=Suite&min_price=100 room/search Literal (child) Query parameters (fromQuery)
/room/about room-about Literal (standalone) Standalone route (not a child)

Note: All links above (except /room/detail/abc) are generated using $this->url('route-name', params) — ZF2 builds the URL from the route configuration. The /room/detail/abc link is hardcoded because it deliberately fails the route constraint.