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
Unable to run migrations on GCP with CakePHP 3.8
I am trying to set up my CakePHP 3.8 project on a GCP "Compute Engine" VM.
I have set up my app.php to use the following DB configuration:
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'persistent' =>…

user4838338
- 83
- 1
- 5
1
vote
2 answers
Cakephp 3 Not Recognizing Custom Validation Rule Method and Validation Messages Not Showing
First issue is I have the following validators and public function in my table
UsersTable.php
$validator
->scalar('name')
->maxLength('name', 45)
->requirePresence('name', 'create')
->notEmptyString('name', 'You…

perl_noobee
- 63
- 4
1
vote
0 answers
Show total in shopping cart - Cakephp 3
Friends, I appreciate if anyone can analyze.
I'm having trouble displaying the total price in the shopping cart.
my index.ctp looks like this:
request->getSession()->read('cart') as $index=>$cart): ?>
=…

E. Biagi
- 452
- 3
- 12
1
vote
1 answer
Upgrade CakePHP install from 3.0.13 to 3.8
I have a working installation with CakePHP 3.0.13. I'd like to upgrade to 3.8 before trying to jump to the 4.x branch. I've launched this: composer require cakephp/cakephp:3.8.12 and I get the next results:
./composer.json has been updated
Loading…

pperejon
- 443
- 5
- 19
1
vote
0 answers
CakePHP 3 - containable behaviour not working on Models even though they are linked
CakePHP 3.5.13
I have several Models and each has a Table class with relationships defined.
// src/Model/Table/DisplaySubstancesTable.php
public function initialize(array $config)
{
$this->belongsTo('Displays', [
'foreignKey' =>…

Andy
- 5,142
- 11
- 58
- 131
1
vote
1 answer
CakePHP ORM : Query with a join on the same table with a non-standard association
I have a very particular use case, and i can't find a clean solution with the ORM. I've searched a lot, and maybe my database model is not correct, I'm not sure.
I use CakePHP 3.8.11.
So, I have a table "MaintenanceTypes" with 3 important fields :…

Denis Valdenaire aka Joe Linux
- 312
- 1
- 2
- 11
1
vote
1 answer
Conflict error during CakePHP 3.8.10 to 4.x upgrade
I want to upgrade the CakePHP framework behind our project. Currently we are using the 3.8.10 version.
I did all the steps to complete the process described here:
https://book.cakephp.org/4/en/appendices/4-0-upgrade-guide.html
(I have no, errors,…

Sanyos
- 41
- 3
1
vote
1 answer
Cakephp 3 query with conditions array build in foreach loop
Hello i want to use an array as condition.
For example i have services with a zip as combination
12345 => cleaning,
54321 => cleaning
now i build my array together in a foreach loop
$searcharray = [];
foreach($services as $key => $val){
…

andre.hey
- 199
- 1
- 2
- 13
1
vote
1 answer
Array structure of raw SQL query results in CakePHP 3.8 / CakePHP 4 vs CakePHP 2
After CakePHP 4.0 has been released, we are considering to migrate our CakePHP 2.x application to 3.8 or 4.0. Currently, we are stuck with this issue:
Our application uses raw SQL statements sometimes using the Model::query() method.
For example,…

anweibel
- 485
- 4
- 10
1
vote
1 answer
Change url to article in Cakephp
I create a new website. In the old one I had the url to an article like:
www.mysite.com/article,{article_id},{article_title}.html
I want to change the structure of my url in cakephp without losing my SEO position in google. How can I do it ?
I use…

Matthew
- 11
- 1
1
vote
1 answer
CakePHP 3 - using IN...SELECT in a custom finder
I have written a custom finder method as follows:
public function findSubstanceListNotifications(Query $query, array $options)
{
$date_start = $options['date_start'];
$date_end = $options['date_end'];
$list_id = $options['list_id'];
…

Andy
- 5,142
- 11
- 58
- 131
1
vote
1 answer
Cakephp 3 unauthorizedRedirect not working
I'm doing a page trying to set the unauthorizedRedirect for the auth component in the AppController and is not working, it does nothing.
i have tried putting it on false and nothing works
This is the app controller
public function initialize()
{
…

Enrique Oquendo
- 13
- 2
1
vote
1 answer
Install CakePHP on OS X w/ Composer Fails, lib-icu ^62.1 has the wrong version installed
I am trying to add a package via composer on OS X to my CakePHP Application...
└──╼ composer require nbobtc/bitcoind-php
Using version ^2.1 for nbobtc/bitcoind-php
./composer.json has been updated
Loading composer repositories with package…

Jeffrey L. Roberts
- 2,844
- 5
- 34
- 69
1
vote
0 answers
FullCalendar cannot display events in cakephp3.x
I know this question has been asked by many people but I still have not found the answer to solve the problem
TutorsController:
public function index()
{
$this->loadModel('Events');
$events = $this->Events->find('all');
foreach…
user11265015
1
vote
1 answer
Sending multiple values from form to controller with cakephp3
I'm making a form to search my application for users with their name or email. Specifically, I am trying to make a search engine, but I don't know how to send two parameters from my form to my controller in cakephp3.
// In my controller
…

Cristian Quevedo
- 21
- 3