Table of Contents The pipeline: build, resolve, render Building: PHP, arrays, or a database row Tree manipulation: reorder, move, merge, split Named menus and the helper The rest of the helper Resolvers: active state and visibility, without if-trees in your menu code Active matching, all the way down Renderers: pick the shape, keep the tree A small detour: keeping the tree honest Things you only notice once you’ve used it for a week Why it’s small on purpose Get it Every CakePHP project I’ve ever opened has the same file. It’s called something like MenuHelper.php or Navigation.php, it lives somewhere in src/View/Helper/, and it grows a new if ($this->request->getParam('controller') === ...) branch every quarter. By the time anyone notices, the helper is doing three jobs at once — declaring the tree, deciding which entry is active, and emitting the markup — and changing any one of them risks breaking the other two. Over time I also often used the Tools.Tree helper to build tree…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.