Jump to content

Method will not run.


Zugzwangle

Recommended Posts

I have the following code:

$new_model = new Model;
$check_valid = $new_model->check_invalid_lineup($team_selection);

echo $check_valid fails to work.

 

I have checked, it is a valid function, with in my Model class, and I have set it to simply return the input parameter. So it looks like this: 

public function check_invalid_lineup($teamid)
    {   
        return $teamid;
}

The variable $team_selection, is gained from another method in the Model class, instantiated  by: 

$new_model    = new Model;
        $user_info_select = $new_model->user_info();
        $team_selection = $user_info_select['team'];

I am stumped as to why I can echo $team_selection with no problem, yet when I insert it as a parameter in the function, check_invalid_lineup() it fails to work! 

Have been puzzling over this for a good few days, shifting code and having no success. Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/282324-method-will-not-run/
Share on other sites

You've posted a few snippets but nothing that shows them all together. What's the whole reproduce script? It sounds like you're describing

$new_model    = new Model;
$user_info_select = $new_model->user_info();
$team_selection = $user_info_select['team'];

echo $team_selection; // something

$check_valid = $new_model->check_invalid_lineup($team_selection);

echo $check_valid; // nothing
Link to comment
https://forums.phpfreaks.com/topic/282324-method-will-not-run/#findComment-1450456
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.