1
Good evening, how do I get a specific field on my table. I wanted to take this field and receive it in a variable and show in the view. Thank you!!
1
Good evening, how do I get a specific field on my table. I wanted to take this field and receive it in a variable and show in the view. Thank you!!
3
Is the view relative to the same table model or different? If it is the same:
$total = $sales['Sale']['valor'];
If it’s different, in your view controller, it’s:
public function view(){
$this->loadModel('Sale');
$sales = $this->Sale->find('list', array('fields' => array('Sale.valor')));
$this->set('valor', $valor);
So in view.ctp:
$total = $valor['Sale']['valor'];
Browser other questions tagged cakephp-2
You are not signed in. Login or sign up in order to post.
Explain a little better, how is the table, which field you want to pick up, how is your model, your controller and your view. Use the question’s [Edit] link to add this information.
– bfavaretto
table Sales with the value field, I want to take it and put in a variable called $total and send to the view
– Everton Silva
Salescontroller, Sale, managed everything beautiful
– Everton Silva