• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 282
  • Last Modified:

CFModule converted for PHP

I am looking for a PHP equivalent of the cfmodule function. In my example, I am passing variables as well.  Is there a good PHP equivalent to this?

<cfmodule name="request.displayTable"
	jobinfoid="#np.id#"
	jobarea="ALL"
	jobtype="summary">

Open in new window

0
mopar003
Asked:
mopar003
  • 3
  • 2
1 Solution
 
Ray PaseurCommented:
Since I don't really understand ColdFusion, this may be a little bit speculative, but I'll tell you what I think I am seeing here.  It looks like a data base query asking for something like this:

SELECT * FROM displayTable WHERE jobinfoid = '$np->id' AND jobarea = 'ALL' AND jobtype = 'summary'

In this query statement, $np is an object, and id is a property of the object.  There is no requirement for this to be the case; the variable might be any string or integer value.  I was just echoing what I think CF is talking about.
 
Does that sound like it's on the right track?
0
 
mopar003Author Commented:
Nope.  CFModule is kind of like a big brother to the include file and/or functions.  It has a single depository location outside of the websites and allows multiple sites to call the same functions, without having to have duplicated code.
0
 
Ray PaseurCommented:
Gotcha.  Here is what I recommend.  Make a copy of this question, then delete it and repost it anew.  Some of the EE community will not look at questions when there is already a dialog in process, assuming that the question is getting handled.  In this case, it's not, and a fresh post will be likely to get more eyes on it.  Best regards, ~Ray
0
 
mopar003Author Commented:
Not the greatest workaround, but what I did was to include a base functions.php file in the php.ini file under (auto_prepend_file = "C:\PHP\CustomTags\functions.php"), which can include all of my existing functions.  Then call a function, passing the variables and getting the returned results.  

The only downside I see is that EVERY php page will call this and I am not sure if this will slow down PHP, since it may be loading in 1000 functions for every page, even though you may not be referencing them.
0
 
mopar003Author Commented:
Works, but not very elegant.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now