Jump to content

How to make a custom MainController::Run in phpvms 5.5x


Daniboi

Recommended Posts

Hello people, so I want to make a custom MainController::Run like this example here:

<?php MainController::Run('PIREPS' 'RecentFrontPage', 5); ?>

so that will go and insert the 5 newest flights, but I want to make a custom one, How could I do that?

Link to comment
Share on other sites

Just create a module (or add to an existing module) in core/modules/MODULE NAME/MODULE NAME.php and inside it add a function with your data in it. See the example here (the code for what you provided) https://github.com/DavidJClark/phpvms_5.5.x/blob/master/core/modules/PIREPS/PIREPS.php#L517

 

Then you can use

<?php MainController::Run('MODULE NAME' 'FUNCTION NAME', ADDITIONAL PARAMETERS); ?>

 

  • Like 1
Link to comment
Share on other sites

I got code working, but not correctly. It is just showing 5 in sequence by flight number. And I think I know why, when you add a schedule there is no date associated with the entry in the db But there is in the PIREPS table. I will work on it and try to get it to work. When I do I will upload the code to my github account.

  • Like 1
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...