Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
By syren-1 on
Is it possible to call an include file with PHP in the middle of a module?
Is it possible to call an include file with PHP in the middle of a module?
Comments
This is a nifty thing to
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
Yes!
Of course. A drupal module is just a normal php file, so just use
include 'file.php';
or
require 'file.php'
as normal.
Not quite, either the
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.