User login

Passing an argument to a Drupal form through hook_menu and use of drupal_get_form

It works. Count how many parts to the menu path there are (text between slashes) and put that number in as a page argument in the array provided for this. (This actually means to grab the /next/ piece of the menu path to use , because the system's counting starts at zero.

Passing Arguments to Form Functions through hook_menu()
http://drupal.org/node/457782

Drupal 6: Passing values to menu items when using drupal_get_form
http://drupal.org/node/205486

Searched words: 
drupal menu passing argument to form

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.