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
3
votes
1 answer
cakephp 3 Cron Job not working in cpanel
I am trying to implement cron job in cakephp 3 shell script but it is not working in cpanel.
below is my cron job code blog is my cakephp 3 folder
cd /home/mmentert/public_html/abc.com/blog && bin/cake hello main
Cakephp 3 shell class…

Sharma Vikram
- 2,440
- 6
- 23
- 46
3
votes
1 answer
CakePHP 3 Controller Event Implementation Example
The CakePHP 3.0 documentation includes an example of how to create an event using a model as an example. I've tried and tried and it's just not translating for me. Does anyone have a CakePHP 3.x example of using a custom event where a controller…

Richard
- 5,584
- 1
- 19
- 22
3
votes
1 answer
How to get CakePdf to work in CakePHP 3.x?
I have installed CakePdf plugin in app/plugins folder and followed all the documentation possbile, thus my settings are as following:
// config/bootstrap.php
Plugin::load('CakePdf', ['bootstrap' => true, 'routes' =>…

WpDoe
- 476
- 1
- 7
- 22
3
votes
2 answers
Cakephp 3 - get fields and conditions in beforefind
In cakephp 2.x in beforeFind I could check if some condition is set by
!empty($queryData['conditions'][$this->alias.'.field']) or get the list of fields that would be retrived simply by $queryData['fields']. How to achieve this in cakephp 3.x ?
In…

dav
- 8,931
- 15
- 76
- 140
3
votes
1 answer
Cakephp 3 - Unit test validationDefault
I'm currently trying to write a unit test for the following model:

markvdlaan93
- 613
- 10
- 26
3
votes
1 answer
How to Install CakePHP 3 in subdirectory
How do I install CakePHP 3 in a subdirectory? So far, I've only found that I should set my App.base variable in config/app.php file, but I've tried every path I can think of, but only get 500 error.
Overview of how it should end up:
User goes to…

Dave
- 28,833
- 23
- 113
- 183
3
votes
1 answer
MapReduce not working in CakePHP 3.x
I'm using CakePHP 3.x, my application has add/edit pages, in edit action I'm using this code.
$patient = $this->Patients->get($patientId);
to get record of patient.
Now I want to modify value of some field after find operation, let say I want to…

Dr Magneto
- 981
- 1
- 8
- 18
3
votes
2 answers
$this->Auth->identify(); returning false in cakephp 3.2
I have done all the settings for login in cakephp 3.2,but while login it is returning false.
login function in usercontroller
public function login() {
$this->viewBuilder()->layout('');
if ($this->request->is('post')) {
…

sradha
- 2,216
- 1
- 28
- 48
3
votes
1 answer
CakePHP 3.x checkbox formatting issue
This may seem obvious to some of you, but I really am struggling to find a straight answer. I've generally googled, as well as read both the CakePHP manual and the API for an answer to the following question:
When creating an input, the following…

elb98rm
- 670
- 6
- 21
3
votes
1 answer
Subqueries in CakePHP 3?
I have two tables products and product_categories that are associated through a third table, products_categories_products, according to CakePHP BelongsToMany conventions (Edit: these associations are established in ProductsTable.php and…

Libertie
- 141
- 1
- 10
3
votes
2 answers
Get current plugin name in plugin element CakePHP 3
I am making a application where I need to create a element so that I can copy paste the element file into another plugin's element without changing anything.
For that I need to have a dynamic piece of code which can automatically have the current…
user5582608
2
votes
1 answer
CakePHP Authentication Middleware not called
I used AuthComponent a lot but am new to AuthenticationMiddleware. I follow almost exactly https://book.cakephp.org/authentication/2/en/index.html except the username field is username instead of email. But when I try to get a page requiring…

cpliu338
- 645
- 1
- 7
- 20
2
votes
1 answer
Cakephp 3 Authentication plugin, login URL did not match
I want to use the Authentication plugin for CakePHP 3.8 and I'm having problems that are not in documentation.
After follow Getting Started (https://book.cakephp.org/authentication/1/en/index.html) I have one question.
Originally $fields were…

Marco C
- 111
- 1
- 13
2
votes
0 answers
CakePHP 3 belongsToMany conditions
I have a problem with declaring conditions for my BTM association - probably missunderstood something.
Imagine a few tables - Notes, NotesEntities, Entities (the last one is not an actual table, but can be any table like Products, Customers,…

Vojtěch Šalda
- 85
- 8
2
votes
1 answer
How to use associated data with the list finder?
I m creating options for my dropdown using find with list.
But i want to fetch the data of associated table.
Given below is my code
$users = $this->UserRoles
->find('list', [
'contain' => ['Users'],
'limit' => 200,
…

Akshay Naik
- 553
- 3
- 17