Skip to content

Instantly share code, notes, and snippets.

View kleberksms's full-sized avatar

Kleber Syd Moraes da Silva kleberksms

View GitHub Profile
<?php
/**
* Controller
*/
public function getDados($id = null){
$dados = $this->Model->find('all',array('conditions'=>array($this->Model->primaryKey => $id)));
$this->set(compact('dados')); //isso significa que a variavel $dados é compactada em 'dados' no set compact, mas você pode enviar asssim tb
//$this->set('dados',$dados);
}
//View
<?php
foreach ($response->subcategory as $subcategory) {
$s = $subcategory->subcategory;
echo "Imagem: <img src='{$s->thumbnail->url}'><br />";
echo "Nome: {$s->name}<br />";
echo "link da subcategoria: {$this->Html->link($s->name, array(
<?php
//view
// view Users/cadastro.ctp
$this->Form->create(false,array('controller'=>'designers','action'=>'register'));
$this->Form->input('whatever');
$this->Form->submit('save');
$this->Form->end();
$this->Form->create(false,array('controller'=>'users','action'=>'register'));
@kleberksms
kleberksms / errors.php
Last active December 30, 2015 19:59
error message =/
<?php
/**model**/
App::uses('AppModel', 'Model');
/**
* User Model
*
* @property Wishlist $Wishlist
<?php
/**
* Application level Controller
*
* This file is application-wide controller file. You can put all
* application-wide controller-related methods here.
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
<?php
/**
* Application level Controller
*
* This file is application-wide controller file. You can put all
* application-wide controller-related methods here.
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
<?php
namespace Core\Entity;
class AbstractEntity
{
protected $atribute;
}
@kleberksms
kleberksms / aula.ual
Created March 21, 2015 00:12
aula.ual
prog aula
real peso;
real altura;
real imc;
logico deveentrar;
deveentrar <- verdadeiro;
imprima "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
@kleberksms
kleberksms / razor
Created July 1, 2015 00:53
Colocar default value
@Html.DropDownListFor(model => model.ParentId, (IEnumerable<SelectListItem>)ViewBag.ParentId, new { @class = "form-control" })
@kleberksms
kleberksms / tableestacio.html
Created October 12, 2015 15:05
Exercício para Fórum C estácio
<table>
<tbody>
<tr>
<td colspan="3"></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>