Skip to content

Instantly share code, notes, and snippets.

View elminson's full-sized avatar

Elminson De Oleo Baez elminson

View GitHub Profile
function getWaterState($degrees)
{
$stateMessage = 'This is liquid water';
if ($degrees < 0) {
$stateMessage = 'This is solid ice';
}
if ($degrees > 100) {
function getWaterState($degrees)
{
if ($degrees < 0) {
return 'This is solid ice';
}
if ($degrees > 100) {
return 'This is gaz water';
}
<?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;