LARAVEL-PHP:mvc
return $respuesta;
}
}
Class ModeloDatos{
/*=============================================
Datos
=============================================*/
public function getDatos(){
#include() Se utiliza para invocar el archivo que contiene código html-php.
$arreglo = array( 1, 2, 'tres', 'cuatro' );
return $arreglo;
}
/*
$respuesta = array( 1, 2, 'tres', 'cuatro' );
//$respuesta = Controlador::getDatos();
foreach ($respuesta as $val){
echo"<br>";
echo "Valores:".$val;echo"<br>";
echo"<hr>";
}*/
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
$respuesta = Controlador::getDatos();
foreach ($respuesta as $val){
echo"<br>";
echo "Valores:".$val;echo"<br>";
echo"<hr>";
}
?>
</body>
</html>
Comentarios
Publicar un comentario