Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/24/19 in all areas

  1. Hello, greetings from India [Quick fix, change your file name to TourenData.class.php] Assuming you are asking how to get data into the DataClass, the answer to that would be "using SQL". Example: public static function GetTourenData() { // Getting all values from a table $sql = "SELECT * FROM `phpvms_tourendata`"; return DB::get_results($sql); } If you need to use a variable in the module, assuming that it is already establed (coded) in the DataClass (core/common) folder, all you'll have to do is to just assign a variable to display the value. Example: In ACARSData.class.php, you have a static function called "GetACARSData()" which returns an array. The idea is to get your static function inside TourenData.class.php to return some value. Once that is done, you can call that inside your module like this... Assuming we are coding in the public index function of your module, code this way $this->set('tourendata', TourenData::GetTourenData()); $this->render('touren.tpl'); So now, phpVMS is assigning the values of TourenData::GetTourenData() function into a variable called "$tourendata" which you can use in the template file. One more way I have seen people using this is, to set the data to the variable instead of using "this", Template::set('tourendata', TourenData::GetTourenData()); nevertheless, both methods work. Let me know if this was of any help, Regards, Leonard
    1 point
×
×
  • Create New...