Questions tagged as 'cakephp-2'

2
answers

In php how to execute certain function after past X days of last execution

I'm developing changes and routines in a web application created in PHP and CakePHP, in case one of the routines would be a Component run every 15 days, to update an .html file As in PHP, do I check if X has been past days of the last execution...
asked by 01.08.2014 / 14:49
2
answers

Change value of a select in CakePHP

I am making a system, and have a part of it that needed a select . The names inside the select are being displayed, but the data stored in the database (mysql) are relative to the 'id' field, and need to be written to the 'name' fie...
asked by 01.07.2014 / 21:45
2
answers

How to count how many rows a query to the database returned (Cake PHP)?

$this->Post->Comment->find ('all', array('conditions' => array('Comment.post_id' => $id))); I make this query, how do I know if it returned 5, 7, 10 ... comments before displaying them in the view?     
asked by 23.12.2014 / 00:09
1
answer

How do I get a record saved in the Cakephp database

Good evening, how do I get a specific field in my table. I wanted to get this field and get into a variable and show in the view. Thank you !!     
asked by 31.01.2015 / 01:44
1
answer

Query does not return all registry data

The following query returns the correct record but missing items on its return. $nota = $this->Nota->find('first', [ 'conditions' => ['id' => $numero, 'serie' => $serie ] ]); For example: When no error, return...
asked by 19.12.2016 / 17:45
1
answer

Doubt with conditions in cakephp?

I'm trying to make a conditions into a find . I have 2 tables: tipopessoas and pessoas , in table pessoas I have a foreign key for table tipopessoas . I want my find to bring the result just for two types o...
asked by 01.09.2015 / 14:54
1
answer

How to make two relationships for the same table?

I have a table named advertencias , in this table I have 2 foreign key for the same table named pessoas in this table person I have two types of Person Student and Teacher, then in table advertencias when I am going to create...
asked by 26.08.2015 / 07:55
1
answer

Get data from another Model

I'm not getting a phone related to a user in View edit() . I can get the phone number in ver() but not edit() . Controller Patient : public function edit($id = null) { if (!$this->Patient->exists($id)) {...
asked by 16.04.2015 / 20:14
1
answer

How to use the "response" of an XMLHTTPREQUEST in CakePHP (2.5)

CONCLUSION: I put up here to get the view right, I was using onClick to fetch this function, but I was leaving the request out of the function so it was not working. I have an action in the controller Posts: public functi...
asked by 16.01.2015 / 09:19
1
answer

How to pass parameters using cakePHP's redirect?

I'm using the following code snippet in my controller: $this->redirect(array('action' => 'duplicate', $contact)); The $ contact variable contains an array. The command redirects to the duplicate function, but does not pass t...
asked by 13.01.2015 / 18:18