Last active
December 27, 2015 11:19
-
-
Save kleberksms/7317686 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); | |
} | |
?> | |
<?php | |
/** | |
* View | |
*/ | |
//na view os dados vem assim: | |
$dados //=D | |
echo $this->Form->input('Model.campo',array('type'=>'text','value'=>$dados['Model']['campo'])); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment