Questions tagged [cakephp3]
30 questions
0
votes
1 answer
How to paginate an array query result in cakephp 3
Hello, I have an array of query results that I want to be paginated. But somehow I got an error that says :
Unable to locate an object compatible with paginate.
Here's my current code:
$this->paginate = ['limit' => 10];
$comment…

Karl
- 37
- 5
0
votes
2 answers
CakePHP3 path to template file error on json calls
I've just converted an ajax call to return json instead of HTML.
If I
make the request manually or via postman I get the expected result.
call from my site using ajax I get an error.
use devtools/Network to open in new tab I get the expected…

Sarah K
- 363
- 2
- 15
0
votes
1 answer
CakePHP 3 - executing multiple Commands from 1 Command and logging errors if they occur
I'm building an application in CakePHP 3.8 which uses Console Commands to execute several processes.
These processes are quite resource intensive so I've written them with Commands because they would easily time-out if executed in a browser.
There…

Andy
- 5,142
- 11
- 58
- 131
0
votes
0 answers
I get error when try to call action using ajax in cakephp 3x
I try to call action from another controller via jquery using ajax.
jquery:
$('.sorting-action').on('click', function (event) {
event.preventDefault();
var elem = $(this);
var root_path = $(this).data('root_path');
postData = {folder_path:…

Sergey Georgiev
- 11
- 1
0
votes
1 answer
Cakephp compact array
In my function index() this code not return all
$this->paginate = [
'contain' => ['TipoPlatos','TipoArticulos'],
];
$platos = $this->paginate($this->Platos);
$this->set(compact('platos'));
This only return 20 platos but i have 23.…

daniellandete
- 121
- 8
0
votes
1 answer
cakephp3 redis not configured properly
I am having a super hard time getting redis to be configured. It was working, but I upgraded my servers and composer updated- now I getting "redis is not configured correctly"
define('_CACHE_SERVER', '*********.cache.amazonaws.com:6379');
…

mconnors
- 155
- 2
- 13
0
votes
1 answer
Where is the result of sum?
I want to sum a field tiempo_acumulado for each tarea_id. I try this but dont work, is wrong or how can do this.
foreach ($idstareas as $idtarea)
{
$sumatorio = $this->ProyectosCategoriasTareas->find();
$sumatorio
…

daniellandete
- 121
- 8
0
votes
0 answers
Access request params inside beforeFind cakePHP 3.6
I have a table object Users in a CakePHP 3.6 application that has a beforeFind callback like so:
public function beforeFind(Event $event, Query $query, $options = []) {
$query->where(['Users.active']);
return $query;
}
As you can see…

user765368
- 19,590
- 27
- 96
- 167
0
votes
1 answer
flash message and redirect in cakephp3
I have the below code in one of my controller files.$this->Flash->error("error message!");
return $this->redirect(['controller' => 'users', 'action' => 'home']);.My problem is, flash message is not displaying on the redirected page. Can anyone help?

web_developer
- 71
- 1
- 9
0
votes
0 answers
integration of ssl in cakephp 3
I wanted my application to use https instead of http, so after some research i made some changes in .htaccess file, now my file looks something like this
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$…

Tarun Madaan
- 401
- 1
- 8
- 20
0
votes
0 answers
CakePHP 3.8 changing urls generated by Paginator numbers to relative
The app has some prefixed routes like so:
Router::scope('/ru', function (RouteBuilder $routes) {
$lang = 2;
$routes->setRouteClass(DashedRoute::class);
$routes->connect('/:slug', ['controller' => 'Pages',…

Yevgeniy
- 300
- 2
- 7
0
votes
1 answer
CakePHP3&PHPStan: How to remove `undefined method..` model errors when run PHPStan for CakePHP3 app
When run PHPStan for CakePHP3 app, Call to an undefined method errors always occurs
in the lines using CakePHP3 Dynamic Finders
How do I remove errors like dynamic methods?
/**
* @property \App\Model\Table\ArticlesTable $Articles
*/
class…

masy
- 23
- 3
0
votes
1 answer
How to use case in this case - CakePhp 3
I have to upgrade the version of cakephp ( x2 to x3 ), I have to translate this horrible sql expression.
I started to translate but I am blocked each time.
public function getDefautPPKLAC($nuit, $date_deb, $date_fin) {
return…

Léanna JI
- 5
- 3
0
votes
1 answer
Cannot update records in CakePHP 3.8
Problem I have is that I cannot update records in my CakePHP 3.8 application, that it's installed on live server. On my development server it works fine.
I can insert new, I can delete, I can select, but I am unable to update any record.
(Of course,…

user198003
- 11,029
- 28
- 94
- 152
-1
votes
1 answer
Cakephp 3 prefix routing not working in linux server after SSL added
CakePHP Version: 3.6
I created a project with 3 route prefixes: admin, vendor and customer.
On my local machine it is working fine, all the prefixes are working fine. I moved my project to a remote Linux server and it was working fine at first. Once…

kathir krtb
- 3
- 2