• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

help with pulling function in twig

hiquezerah

New Member
Joined
Dec 24, 2020
Messages
11
Reaction score
1
I am using myacc

hello guys, I'm looking for a way to pull a function to the twig file, I'm making some changes in my character view.
I'm wanting to pull a value from a storage that the player has for the twig.
Example:
1654743945647.png
I managed to add this function in php and it worked. But I'm not able to use it in a twig, could someone help me?

Function.php
function reborn(){
global $db, $config;

$resposta = $db->query('SELECT * FROM player_storage WHERE KEY = 30024;');
return $resposta;
}
$rebornado = 0;
foreach(reborn() as $rbStorage){
if ($rbStorage['player_id'] == $listPlayer['id']){
echo'<td>Rebornado level<br>'. $rbStorage['value'] . '</td>';
$rebornado = 1;
break;
}
}
if ($rebornado == 0)
echo'<td>Não rebornado</td>';
$rebornado = 0;
using these 2 codes I managed to add to php.
But now I'm needing to add to the twig file.
Example:
1654744291378.png
could someone tell me how can i call the "reborn" function inside character.html.twig?
@slaw
 
Back
Top