Questions about 3.x branch of the CakePHP MVC framework. Use this tag in combination with the general [cakephp] tag. If your question applies to CakePHP more generally, use only the [cakephp] tag.
Questions tagged [cakephp-3.x]
963 questions
1
vote
1 answer
Add One to Integer Column Using Query in CakePHP 3
I dont recall exactly how, but I do remember being able to add one to an integer column in mysql with a query without knowing the value of that integer column...
something like
update table set column=column+1 where id=1
I am wondering, how can I…

Jeffrey L. Roberts
- 2,844
- 5
- 34
- 69
1
vote
1 answer
How do CakePHP callback functions know that $q is a Query object and which table to execute the query on?
I'm trying to understand some basic functionality and I'm not sure exactly what topic it falls under. I'm working in CakePHP and I'm trying to understand how these nested callback functions just seem to know what they're supposed to do. I think a…

Mark W
- 13
- 3
1
vote
1 answer
CakePHP 3.x JWT Auth Server
I have two applications in CakePHP 3.5. Each of them requires login data and other operations. I do not want to copy data between two databases, nor duplicate connections to the database with the Users table, and I do not want to copy functionality…

wojtek6000
- 65
- 8
1
vote
1 answer
CakePHP3 Changing Database Connections in Plugins
I have problems with switching a database connection in CakePHP3.
I would like to change the database connection (based on a subdomain, MultiTenant system). But I would like to outsource this connection-change to a plugin.
For this I wrote a small…

chriss
- 320
- 2
- 15
1
vote
1 answer
Organize a groupBy within another groupBy using Collection in CakePHP
I have the following array and I would like to be able to organize it through collection
$collection = Collection($total);
$filter = $collection->groupBy('date_general')->toArray();
[2017-11-14] => Array
(
[0] => Array
(
…

Andres Wilches
- 39
- 6
1
vote
1 answer
View inside a view using CakePHP 3
Is it possible to display a view inside another view?
I have the following code:
type === 'brochure') : ?>
// massive template block
type === 'library') : ?>
//…

Bird87 ZA
- 2,313
- 8
- 36
- 69
1
vote
0 answers
How to use 'order' in CakePHP3?
I'm trying to order a set of results but for some reason it doesn't get ordered properly. Am i making some kind of a mistake here?
$quotations = $this->Quotations->find()
->select(['Quotations.id' , 'Quotations.created' ,…

Kasun Wijesekara
- 167
- 1
- 1
- 13
1
vote
1 answer
CakePHP 3 Serve Files From Plugin Webroot
I am under the impression that any files placed in the webroot/ folder of a plugin in CakePHP 3 should be served automagically. However, I have not been able to get a file to be served from that folder...
I have created an example…

Jeffrey L. Roberts
- 2,844
- 5
- 34
- 69
1
vote
2 answers
how to show nested association value cakephp 3
i want to run this code, where it has nested association data :
'VhpProducts.VhpHasilPencapaian',
'Departments.VhpHasilPencapaian',
'Groups.VhpHasilPencapaian' and to sum 'VhpHasilPencapaian.quantity'
but all I got was
Error: SQLSTATE[42S22]:…

Yolanda Simamora
- 21
- 2
- 7
1
vote
1 answer
CakePHP 3: switching between Router scopes
I have a simple routing setup to address different languages. The goal is to have the language as a first parameter in the url like /en/docs or /de/docs. The language definitions are set as scopes as show below:
$builder = function ($routes)
{
…

mixable
- 1,068
- 2
- 12
- 42
1
vote
1 answer
CakePHP 3 Skip Migration in Production
I have a Migration that failed in production after executing several commands that I can not execute again, is there a way to skip a migration?

Jeffrey L. Roberts
- 2,844
- 5
- 34
- 69
1
vote
1 answer
CakePHP 3 Delete Row From Database using Migrations
I was taking a look at https://book.cakephp.org/3.0/en/migrations.html but I did not see anything about deleting a row from the database using Migrations...
How can I delete a row from a table using the migrations shell?

Jeffrey L. Roberts
- 2,844
- 5
- 34
- 69
1
vote
1 answer
How to continue a CakePHP 3 session in a regular PHP script?
My situation is the following. I have a cakephp project and a seperated plain php script running on the same server.
When I use my client browser to connect to the cakephp project, it builds up a session as it should.
Now I want to continue the…

marius
- 1,118
- 1
- 18
- 38
1
vote
2 answers
CakePHP 3 Cache File Permissions
I have a CakePHP 3 app with shells that I run from crontab.
When I run the shells through crontab, it creates cache files owned by the user running the crontab, which is not the user that runs apache...
Sometimes when I run the crontab the cached…

Jeffrey L. Roberts
- 2,844
- 5
- 34
- 69
1
vote
3 answers
Creating Rest API without views using cakePHP 3.5
I'm trying to create Rest API without view and planning to use these api's in angular 2 application. does have any idea about it?

Kumar
- 214
- 2
- 7