将控制器功能设置为链接

I have created simple mvc in php.

My controller is :

class front
{
    function __construct()
    {

    }
    function add_to_cart()
    {
        echo "123";exit;
    }
}

Now, I want to pass id into this controller.

My view page is:

<a href="http://localhost/bhajipala_latest/controllers/front.php/add_to_cart/<?php echo $pr_value['itemID']; ?>" class="site-button-dark"><span>ADD TO CART</span></a>

So, what link I have to write in href to get itemID in add_to_cart function?

I'm not sure about your question but this is simple example of using such functionality

Test.php

<?php
    echo '<a href="../another_test.php/add_to_cart/?id=1231"/>Click Here</a>';
?>

another_test.php

<?php

class A{

    function __construct(){

    }
    function add_to_cart(){
        $id = $_GET['id'];
        return $id;
    }
}

$a = new A();
echo $a->add_to_cart();//1231
{BASE URL : http://localhost/projectname}/{indx.php(ifrequired)}/{CONTROLLER NAME : front}/{METHOD NAME : add_to_cart} / {VALUE : itemID}

In short {http://localhost/projectname}/{indx.php}/{front}/{add_to_cart}/{itemID}

   function add_to_cart($itemID)
    {
        echo $itemID;exit;
    }