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
/**
* 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)
*
@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
//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'));
//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
/**
* 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);
}