Skip to content

Instantly share code, notes, and snippets.

View hugofabricio's full-sized avatar
:octocat:

Hugo hugofabricio

:octocat:
View GitHub Profile
/**
* Painel Delete
*/
public function painel_delete($id = null)
{
// Prova
$this->Task->id = $id;
// Se o registro não for encontrado
<?php
/**
*
* TeamsController
*
*/
App::uses('AppController', 'Controller');
class TeamsController extends AppController {
// Controller
$this->Paginator->settings = array('limit' => 1);
$tasks = $this->paginate('Task');
// Set
$this->set(
array(
'title_for_layout' => 'Ranking',
'tasks' => $tasks
/**
* Index
*/
public function index()
{
// Busca todas as equipes
$teams = $this->Team->find('all', array('conditions' => array('Team.is_active' => true), 'recursive' => -1));
echo
$this->Html->link(
$this->Html->image('theme/nophoto.jpg', array('alt' => 'Prova')),
array(
'controller' => 'tasks',
'action' => 'view',
'id' => $result['Task']['id'],
'slug' => $result['Task']['slug']
),
array(
/**
* Painel Login
*/
public function painel_login()
{
$this->Session->delete('auth_user');
$user = $this->Auth->user();
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="utf-8" />
<title>Curso CSS</title>
<style type="text/css">
ul {
padding: 0;
margin: 0;
list-style: nome;
<?php
/**
*
* DesignerModel
*
*/
define('DESIGNER_DIR', WWW_ROOT . 'img/designers/');
App::uses('AppModel', 'Model');
//Controller
<?php
public function contact()
{
if ($this->request->is('post')):
if ($this->Contact->send($this->request->data)):
$this->Session->setFlash('<div class="text-center">Mensagem enviada com sucesso.</div>', false);
$this->redirect(array('controller' => 'pages', 'action' => 'contact'));
<?php
/**
* UserModel
*/
App::uses('AppModel', 'Model');
class User extends AppModel {
/**