Footes Posted July 7, 2017 Report Share Posted July 7, 2017 I am getting this as an error message could someone advise plz. Invalid argument supplied for foreach() in /var/www/html/phpvms/core/templates/frontpage_recentpilots.tpl on line 3 Quote Link to comment Share on other sites More sharing options...
tim260 Posted July 7, 2017 Report Share Posted July 7, 2017 Can you show us the code of the recentpilots tpl and the frontpage module file? Quote Link to comment Share on other sites More sharing options...
Footes Posted July 7, 2017 Author Report Share Posted July 7, 2017 this is the pilots report code <?phpforeach($pilots as $pilot) { ?> <p><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>"><?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid). ' ' .$pilot->firstname . ' ' . $pilot->lastname?></a></p> <?php } ?> Frontpage.php Quote Link to comment Share on other sites More sharing options...
tim260 Posted July 7, 2017 Report Share Posted July 7, 2017 31 minutes ago, Footes said: this is the pilots report code <?phpforeach($pilots as $pilot) { ?> <p><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>"><?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid). ' ' .$pilot->firstname . ' ' . $pilot->lastname?></a></p> <?php } ?> Frontpage.php Is there any other code on that page or it that it? Cause if so $pilots is not defined. You could do it in the page itself or use the module for example (in your frontpage module): $this->set('pilots',PilotData::getAllPilots()); Quote Link to comment Share on other sites More sharing options...
Footes Posted July 7, 2017 Author Report Share Posted July 7, 2017 no that's the only code thanks for your reply Quote Link to comment Share on other sites More sharing options...
tim260 Posted July 7, 2017 Report Share Posted July 7, 2017 18 minutes ago, Footes said: no that's the only code thanks for your reply No problem, let us know if this worked, or if you need more help! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.