简体   繁体   中英

How to setup a hook with a view in Drupal 7?

So I have a view called "export-spreadsheets". When an admin goes to this page, I want a function to be called so that it basically runs a long SQL query and exports its results to a CSV.

I was wondering where I would add this function to be called?

Thanks.

Make a custom module, add on to the *_menu() hook, make it call the function when you go to a certain url. Have it output the .csv file and die()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM