There was an error!

Exception on file/home/minipetsupplies/public_html/Controllers/ProductCategoryController.php: Call to undefined function getUri()

On line 6

<?php

class ProductCategoryController extends Controller{
    function show(){
        // Get slug from uri
        $uri = getUri();
        $uri = substr($uri, 17);
        
        $data_category = Database::getSingle('SELECT * FROM categories WHERE slug = ?', [$uri]);
        if($data_category == null){
            die('category does not exist!');
        }

        getModel('CategoryModel');
        $category = CategoryModel::connectToId($data_category['id']);
        $demoCategory = $category;
        $parentList = array();

        while($demoCategory->parent() != null){
            array_unshift($parentList, $demoCategory->parent());
            $demoCategory = $demoCategory->parent();
        }

        getView('product-category/show', [
            'category' => $category,
            'parentList' => $parentList
        ]);
    }
}

?>