Jump to content

Including/referencing php files in a template file


Nout - Zon Executive

Recommended Posts

Hi Guys,

I have built a flightplan parser that does all sorts of things including reading airways and breaking them up into their constituent waypoints.

To do this it directly references the X-Plane waypoint databases. Must easier than sending tons of queries to MySQL.

Now I have it all working in parser.php but want to include it into a template file so that it neatly fits into my VA site.

The database file's don't seem to be found even when i reference them with i.e. 'http://www.vasite.com/files/waypoints.idx'

Basically how do I integrate the stuff I have into the Codon interface?

Cheers,

Nout

Link to comment
Share on other sites

  • Administrators

Your best bet would probably be to build a module around your code. The module will already be connected to the database, I am assuming you are using the same db as your phpvms install is, so you would not have to make the connection and such. Build a model class in the common folder to get the data you want, put it together in the module (controller), then use a template to just display the page you would like.

You could also use the pages function and try a php include function, but that is not always a stable method.

Link to comment
Share on other sites

Your best bet would probably be to build a module around your code. The module will already be connected to the database, I am assuming you are using the same db as your phpvms install is, so you would not have to make the connection and such. Build a model class in the common folder to get the data you want, put it together in the module (controller), then use a template to just display the page you would like.

You could also use the pages function and try a php include function, but that is not always a stable method.

Ah I see. Place all the parsing code in the module and then send through the output to the template file which then renders my html table.

That probably will work. I will try that. Yeap I use the phpvms database.

Thanks, Nout

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...