This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getWaterState($degrees) | |
{ | |
$stateMessage = 'This is liquid water'; | |
if ($degrees < 0) { | |
$stateMessage = 'This is solid ice'; | |
} | |
if ($degrees > 100) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getWaterState($degrees) | |
{ | |
if ($degrees < 0) { | |
return 'This is solid ice'; | |
} | |
if ($degrees > 100) { | |
return 'This is gaz water'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__.'/bootstrap.php'; | |
$products = [ | |
[ | |
'name' => 'Monitor', | |
'description' => '55 inches', | |
'value' => 800.00, | |
'date_register' => '2019-06-22', | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="pt-BR"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>App Title</title> | |
</head> | |
<body> | |
{% block content %} | |
{% endblock %} | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$products = [ | |
[ | |
'name' => 'Notebook', | |
'description' => 'Core i7', | |
'value' => 800.00, | |
'date_register' => '2017-06-22', | |
], | |
[ | |
'name' => 'Mouse', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__ . '/bootstrap.php'; | |
echo $twig->render('name.html', ['name' => 'Elminson']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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, [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__.'/vendor/autoload.php'; | |
$loader = new \Twig\Loader\ArrayLoader([ | |
'index' => 'Hello {{ name }}!', | |
]); | |
$twig = new \Twig\Environment($loader); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Allow pretty print with the query parameter ?pretty=true | |
*/ | |
declare(strict_types=1); | |
namespace App\Http\Middleware; | |
use Illuminate\Http\JsonResponse; |