rcrowe / TwigBridge

Give the power of Twig to Laravel
MIT License
894 stars 167 forks source link

calling custom functions inside the twig template #342

Closed spencer237 closed 6 years ago

spencer237 commented 6 years ago

please help to calling this function inside my template twig thanks

function items() {

    global $db;

    $ip_add = getRealUserIp();

    $get_items = "select * from cart where ip_add='$ip_add'";

    $run_items = mysqli_query($db,$get_items);

    $count_items = mysqli_num_rows($run_items);

    return $count_items;
}