[development] gotcha: menu wildcards,foreach() and MENU_SUGGESTED_ITEM
larry at garfieldtech.com
Wed Jul 16 14:47:25 UTC 2008
On Wed, 16 Jul 2008 14:15:05 +0800, "augustin (beginner)" <drupal.beginner at wechange.org> wrote:
> Hi again,
> On the issue, crell write:
> " A foreach loop inside a D6 menu handler is 99% of the time the WRONG way
> do it."
> Have I stumbled upon the 1% of cases where it's the right thing to do?
> If you agree with crell and if I am wrong, I certainly would like to know
> and I'll revert the documentation changes I made.
> What is the proper way to have MENU_SUGGESTED_ITEM with wildcards and
> a loop?
> See the issue for code examples.
I will defer to chx and pwolanin on this front. I am by and large quoting chx here, who said something very similar to me back in February. I won't say you have definitely not found that 1%, but the whole point of all the fancy math in the menu system is to not have to loop but to simply declare matchable patterns. Looping should be very strongly discouraged.
More information about the development