Work with MVC without a framework. I have my route sheet:
<?php
require_once ($_SERVER['DOCUMENT_ROOT'].'/gestionweb/views/template.php');
require_once ($_SERVER['DOCUMENT_ROOT'].'/gestionweb/routes.php');
require_once('routes.php');
if (isset($_GET['controller'])&&isset($_GET['action'])) {
$controller=$_GET['controller'];
$action=$_GET['action'];
call($controller,$action);
} else {
include_once('views/modules/navegacion.php');
$controller='index';
$action='index';
}
?>
The problem comes when I want to edit a record because I want to send the id through an ajax request to another script to get the current data. For example from a client. In the client index.php I have:
<a class="btn btn-warning" href="index.php?controller=cliente&action=editar&id=<?php echo $c['idcliente'];?>">Editar</a>
And the url has a good time ... link
But the fact is that when going to index.php and calling the call function, the id is obviously not sent. What method can I use to achieve this?