Skip to content

Instantly share code, notes, and snippets.

View hugofabricio's full-sized avatar
:octocat:

Hugo Fabriicio hugofabricio

:octocat:
View GitHub Profile
<?php
/**
*
* AppController
*
*/
App::uses('Controller', 'Controller');
class AppController extends Controller {
<form action="/base/painel/usuarios/login" id="UsuarioPainelLoginForm" method="post" accept-charset="utf-8">
<div style="display:none;">
<input type="hidden" name="_method" value="POST"/>
</div>
<div class="input text required">
<label for="UsuarioUsuario">Usuario</label>
<input name="data[Usuario][usuario]" maxlength="20" type="text" value="root" id="UsuarioUsuario" required="required"/>
</div>
<div class="input password">
<label for="UsuarioSenha">Senha</label>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bootstrap 3</title>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<style type="text/css">
h4{color:white}
.row{background:red;margin-bottom:50px}
.col-md-1,.col-md-4,.col-md-6{background:blue}
<?php
App::uses('AppController', 'Controller');
class UsuariosAppController extends AppController {
/**
* Métodos carregados antes da action ser chamada
*/
public function beforeFilter()
public function login()
{
// Ação de Login
if ($this->request->is('post')):
if ($this->Auth->login()):
$this->redirect($this->Auth->redirectUrl());
else:
$this->Session->setFlash('Usuário ou senha inválidos, tente novamente.');
public class ListaSequencial {
Carro [] carros = new Carro[100];
int n = 0;
boolean isVazia(){
return (n == 0);
}
<?php
/**
* This is the PHP base ACL configuration file.
*
* Use it to configure access control of your Cake application.
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
<?php
/**
* AclPhp
*
* Como utilizar?
*
* 1. Crie o model User em sua aplicação, com os seguintes atributos:
* username, group_id, password, email, firstname, lastname e assim por diante.
*
* 2. Configure o AuthComponent autorizar ações via:
<article class="col-xs-12 col-sm-6 col-md-6">
<figure class="post-img">
<img src="images/artigo1.jpg" alt="Web Standards">
<figcaption>
<a href="#"><h2>Web Standards</h2></a>
<a href="#"><h3>Lorem ipsum dolor</h3></a>
</figcaption>
</figure>
</article>
<?php
/**
*
* TaskModel
*
*/
define('UPLOAD_DIR', WWW_ROOT . 'img/tasks/');
App::uses('AppModel', 'Model');