It seems to me that the "page_example_menu" text is not right, since it's supposed to be documenting the actual "page_example_menu" code, but it doesn't. For example, it talks about "baz" which is not in the actual code. To use "baz" might be OK as an example, but this documentation is trying to document the actual "page_example" code, so should talk about the functions used there. As it is, it's very confusing to me as a person trying to learn how to do modules. Unfortunately I'm not best placed to rewrite it.
I think, for example, the text should say something more like:
* If the user accesses http://example.com/?q=examples/page_example/arguments/1/2, the menu system
* will first look for:
* examples/page_example/arguments/1/2.
* Not finding a match, it will look for:
* examples/page_example/arguments/1/%.
* Again not finding a match, it will look for:
* examples/page_example/arguments/%/2.
* Yet again not finding a match, it will look for:
* example/arguments/%/%.
* This time it finds a match, and so will execute page_example_arguments(1, 2). Note the parameters
* being passed; this is a very useful technique.
Note, if this is correct there are I think other similar changes to be made.
Comments
Comment #1
jhodgdonMoving to correct issue queue for triage...
Comment #2
pfrenssenThe comments inside the page_example_menu() function need to be updated as well.
Here's an updated version:
Comment #3
rfayPatches are appreciated!
Comment #4
pfrenssenI have incorporated drupalshrek's suggestion and #2 in this patch, and gave the whole documentation for this function an overhaul.
Comment #6
pfrenssen#4: 903050-4.patch queued for re-testing.
Comment #8
rfayThe problem with tests was resolved so now this can be reviewed properly.
Comment #9
rfayOK, slight fixups and I think this is good to go.
Comment #10
rfayD6 testing isn't working, so I just committed this: http://drupal.org/cvs?commit=463782
Thanks so much, @pfrenssen