Skip to content

Instantly share code, notes, and snippets.

@neryuuk
neryuuk / keybase.md
Created February 22, 2017 01:59
keybase.md

Keybase proof

I hereby claim:

  • I am neryuuk on github.
  • I am neryuuk (https://keybase.io/neryuuk) on keybase.
  • I have a public key whose fingerprint is 5F27 0765 165F C99A E5DE 84A3 CEEB 00ED 8AAE 6BFE

To claim this, I am signing this object:

@neryuuk
neryuuk / inscrever.ctp
Created September 1, 2011 03:07
View - Inscrever
<h2>Inscreva-se no evento</h2>
<?php
function newLine($value) {
$replacee = "><";
$replaceBy = ">\n<";
return str_replace($replacee,$replaceBy,$value);
}
$formFields = array(
$this->Form->create('Inscricao',array(
@neryuuk
neryuuk / inscricao.php
Created September 1, 2011 03:05
Model - Inscricao
<?php
class Inscricao extends AppModel {
public $name = 'Inscricao';
public $useTable = 'inscricoes';
public $cacheQueries = true;
public $order = array('created' => 'DESC');
public $displayField = 'nome';
public $validate = array(
'nome' => array(
'allowEmpty' => false,
@neryuuk
neryuuk / inscricoes_controller.php
Created September 1, 2011 03:00
Controller - Inscricoes
<?php
class InscricoesController extends AppController {
public $name = 'Inscricoes';
public $uses = array('Inscricao');
public function inscrever() {
if (!empty($this->data) && $this->Inscricao->save($this->data)) {
$this->redirect('/obrigado');
}
}