I'm using drupal 7. I want to create a php script that uses Drupals DB abstraction layer to query the database and spit out JSON data. Where would I place such a script? At the moment, I've done it in a round-about way by create a new node, then in the function theme_process_page()
of my theme/template.php
, I wrote an IF statement to detect the node id, then run my code, then call a die() statement.
Is there a more appropriate place for me to put this script?