Cupara
Well-known member
I'm trying to take a variable and pass it to my error phrase. The problem I'm having it figuring out how it works.
I have this:
The result I'm trying to get it similar to this:
If I use the following:
I get an error of mysqli:real_escape_string error, expecting string but array is given or something like that.
Another issue I discovered is that when I try to pass the league_name, only id is passed.
I changed $id to $params but only id is still passed. I'm not sure what else to go with as I have a ton of work left on this project so I need to move on to the next page so that is why I'm posting here so I can move on for now and come back to it later once I find a resolution through help here or figure it out after I lose all my hair from pulling it all out. LMAO
Anyway, thanks to anyone who can lend some assistance.
I have this:
PHP:
return $this->assertRecordExists('Leagues:Leagues', $id, $with, $phraseKey ?: 'bc_admin_league_not_found');
The result I'm trying to get it similar to this:
PHP:
return $this->error(\XF::phrase('bc_admin_league_not_found', ['leagueName' => $leagueName]));
If I use the following:
PHP:
return $this->assertRecordExists('Leagues:Leagues', $id, $with, $phraseKey ?: 'bc_admin_league_not_found', ['leagueName' => $league->league_name]);
I get an error of mysqli:real_escape_string error, expecting string but array is given or something like that.
Another issue I discovered is that when I try to pass the league_name, only id is passed.
PHP:
protected function assertLeagues($id, $with = null, $phraseKey = null)
{
return $this->assertRecordExists('Leagues:Leagues', $id, $with, $phraseKey ?: 'bc_admin_league_not_found');
}
I changed $id to $params but only id is still passed. I'm not sure what else to go with as I have a ton of work left on this project so I need to move on to the next page so that is why I'm posting here so I can move on for now and come back to it later once I find a resolution through help here or figure it out after I lose all my hair from pulling it all out. LMAO
Anyway, thanks to anyone who can lend some assistance.
Last edited: