The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.
Send messages to iframe using iframeEl.contentWindow.postMessage
Recieve messages using window.addEventListener('message')
<?php | |
require_once __DIR__.'/bootstrap.php'; | |
$products = [ | |
[ | |
'name' => 'Monitor', | |
'description' => '55 inches', | |
'value' => 800.00, | |
'date_register' => '2019-06-22', | |
], |
{% extends "layout.html" %} | |
{% block content %} | |
<table border="1" style="width: 80%;"> | |
<thead> | |
<tr> | |
<td>Product</td> | |
<td>Description</td> | |
<td>Value</td> | |
<td>Date</td> |
<!DOCTYPE html> | |
<html lang="pt-BR"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>App Title</title> | |
</head> | |
<body> | |
{% block content %} | |
{% endblock %} | |
</body> |
<?php | |
$products = [ | |
[ | |
'name' => 'Notebook', | |
'description' => 'Core i7', | |
'value' => 800.00, | |
'date_register' => '2017-06-22', | |
], | |
[ | |
'name' => 'Mouse', |
<?php | |
require_once __DIR__ . '/bootstrap.php'; | |
echo $twig->render('name.html', ['name' => 'Elminson']); |
<?php | |
// Load our autoloader | |
require_once __DIR__.'/vendor/autoload.php'; | |
// Specify our Twig templates location | |
$loader = new \Twig\Loader\FilesystemLoader('templates'); | |
// Instantiate our Twig | |
$twig = new \Twig\Environment($loader, [ |
<?php | |
require_once __DIR__.'/vendor/autoload.php'; | |
$loader = new \Twig\Loader\ArrayLoader([ | |
'index' => 'Hello {{ name }}!', | |
]); | |
$twig = new \Twig\Environment($loader); |
<?php | |
/** | |
* Allow pretty print with the query parameter ?pretty=true | |
*/ | |
declare(strict_types=1); | |
namespace App\Http\Middleware; | |
use Illuminate\Http\JsonResponse; |
<?php | |
/** | |
* Created by PhpStorm. | |
* User: elminsondeoleo | |
* Date: 2019-12-23 | |
* Time: 22:13 | |
*/ | |
/** |