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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.

×
×
  • 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.