Drupal: How to Render Results of Form on Same Page as Form

前端 未结 5 1766
走了就别回头了
走了就别回头了 2020-12-10 07:31

How would I print the results of a form submission on the same page as the form itself?

Relevant hook_menu:

    $items[\'admin/content/ncbi_subsites/         


        
5条回答
  •  心在旅途
    2020-12-10 07:46

    Drupal6 node.module and dblog.module do this for admin/content/node and admin/reports/dblog by providing a page callback which includes the rendered form in its output.

    modules/dblog/dblog.admin.inc
    dblog_overview()
    
    modules/node/node.admin.inc
    node_admin_nodes()
    

    In form submit, updated filter settings are stored in $_SESSION.

    In the page callback it renders the results based on the filter settings stored in $_SESSION.

    $_SESSION is just another global here (albeit a persistent one).

提交回复
热议问题