[support] Including files

Matt Connolly matt at cabinetuk.com
Tue Jun 24 12:27:36 UTC 2008


I'm writing a module to custom drupal for our needs.

My question is about including files.

I have some page callbacks, which are defined in my hook_menu function  
like so:

	$items['mymodule/myaction'] = array(
	    'title' => 'Custom Action',
	    'page callback' => 'mymodule_myaction',
	    'type' => MENU_CALLBACK,
	    'file' => 'mymodule.module',
	    'access callback' => TRUE,
	    );

However, common functions, such as `url()` cannot be used because they  
are not included.

I would have thought that `/includes/common.inc` would be already  
included, since drupal has got far enough to call my page callback  
function.

In my handler function, I have had to include:

	require_once './includes/common.inc';
	require_once './includes/path.inc';

to access drupal's functionality that I want.

Or have I missed something really obvious!!?

-matt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20080624/c1e48653/attachment.htm 


More information about the support mailing list