Is it possible to call an include file with PHP in the middle of a module?

Comments

nathandigriz’s picture

This is a nifty thing to have in any CMS development. I have used it twice already in creating a Joomla template.

http://www.hivemindz.com/adding-php-includes-to-drupal-module-functions

vigo-1’s picture

Of course. A drupal module is just a normal php file, so just use
include 'file.php';
or
require 'file.php'
as normal.

nathandigriz’s picture

Not quite, either the include gets called or the function the url directs the page to gets called from within a module. An include in the phptemplate works depending on how you want to use it. If it just adds variables or such then it works fine. But if it parses output the it becomes more difficult. The same applies for Joomla.