Skip to content

Instantly share code, notes, and snippets.

@bulfaitelo
bulfaitelo / test_mod_rewrite.php
Last active March 25, 2017 12:54
Verificando se está ativo o mod_rewrite do Apache
<?php
if(!function_exists('apache_get_modules') ){ phpinfo(); exit; }
$res = 'Módulo não disponível';
if(in_array('mod_rewrite',apache_get_modules()))
$res = 'Módulo disponível';
?>
<html>
<head>
<title>Verificando disponibilidade do mod_rewrite!</title>
</head>
@bulfaitelo
bulfaitelo / index.php
Last active March 25, 2017 12:45
Test basico.
<?php
// FRAMEWORK F3
$f3 = require('lib/base.php');
// 01) Hello World
$f3->route('GET /',
function() {
echo 'Hello, world!';
}
);
$f3->run();
# Enable rewrite engine and route requests to framework
RewriteEngine On
# Some servers require you to specify the `RewriteBase` directive
# In such cases, it should be the path (relative to the document root)
# containing this .htaccess file
# RewriteBase /
RewriteRule ^(tmp)\/|\.ini$ - [R=404]
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
@bulfaitelo
bulfaitelo / index.php
Last active March 25, 2017 12:59
02-About
<?php
// FRAMEWORK F3
$f3 = require('../../lib/base.php');
class webPage {
function display(){
echo "Eu não posso instanciar a um objeto";
}
}
class user {
public static function greet($f3, $args){ // $args são to dipo Vetor
@bulfaitelo
bulfaitelo / index.php
Last active March 25, 2017 12:46
03-Routes_and_Tokens
<?php
// FRAMEWORK F3
$f3 = require('../../lib/base.php');
// 03-Routes_and_Tokens,
$f3->route('GET /',
function() {
echo 'Cervejas!!!';
}
);
$f3->route('GET /brewGet/@count',
@bulfaitelo
bulfaitelo / welcome.blade.php
Last active April 11, 2017 19:26
bulfaitelo.com.br/2017/04/tutorial-laravel-para-iniciantes-parte2.html
<!DOCTYPE html>
<html>
<head>
<title>Bullfaitelo Form test</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1>Bullfaitelo Form test</h1>
<hr />
<!DOCTYPE html>
<html>
<head>
<title>Bullfaitelo Form test</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<div class=”container”>
@bulfaitelo
bulfaitelo / welcome.blade.php
Created April 23, 2017 20:30
Tutorial Laravel para iniciantes - Parte 05 [Validar formulário com FormRequest]
<!DOCTYPE html>
<html>
<head>
<title>Bullfaitelo Form test</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1>Bullfaitelo Form test</h1>
<hr />
@bulfaitelo
bulfaitelo / welcome.blade.php
Last active April 25, 2017 20:35
Tutorial Laravel para iniciantes - Parte 06 [Relacionando models com o Eloquent ORM, criando migrations e seeds]
<!DOCTYPE html>
<html>
<head>
<title>Bullfaitelo Form test</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1>Bullfaitelo Form test</h1>
<hr />
@bulfaitelo
bulfaitelo / listar.blade.php
Created April 29, 2017 19:00
Tutorial Laravel para iniciantes - Parte 06 [Relacionando models com o Eloquent ORM, criando migrations e seeds]
<!DOCTYPE html>
<html>
<head>
<title>Bullfaitelo Form test</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<div class=”container”>