Questions tagged [cakephp-3.x]

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.

963 questions
1
vote
2 answers

Best way to upgrade a Cakephp project from Cakephp 2.6.2 to 3.8

I have been tasked with upgrading a legacy system from Cakephp2.6.2 to Cakephp3.8. Obviously the 2 are drastically different but is there a simple way of getting the old project to work with the new cake version? Or could anyone steer me in the…
Klops
  • 11
  • 1
  • 3
1
vote
0 answers

Is it possible to search MySQL for data encrypted by CakePHP?

I am building an application that includes PII (e.g. telephone number) encrypted using CakePHP's Security Utility. I've patterned my code after the custom database recommended by @ndm -- so AES-256 encryption is taking place at the application level…
Libertie
  • 141
  • 1
  • 10
1
vote
2 answers

Relationship in cakephp3

I am trying to make the relationship between the tables I read The documentations in cakephp3, and tons of post in stackoverflow, and still can’t get any result. I have two tables. category (id, name, published, created, modified) portfolio (id,…
Frost BYTE
  • 11
  • 1
1
vote
1 answer

CakePHP 3 query builder with two like values

How can I modify my CakePHP 3 query builder so that it could have two "like" functions with values (of "OR" logic function)? This works: $exp->eq('b2','my_value')->like('b3','%'.$value.'%') I would like something like this (it does not…
1
vote
2 answers

How to count grouped (groupby / group) records in cakePHP with my current problem?

By using group in cakePHP, we can get the unique records but I need to know how many records are duplicated? I have tried ->formatResults, ->virtualFields, 'fields' => array('Table.column', 'count(*) as virtualColumn'), 'group' =>…
1
vote
1 answer

How to make relationships in cakephp3

I am trying to make the relationship between the tables, but can’t figure out what I doing wrong. I read The documentations in cakephp3, and tons of post in stackoverflow, and still can’t get any result. -------------------------- name …
Angel
  • 55
  • 1
  • 10
1
vote
3 answers

CakePHP Authentication login action

I am trying to set up the new Authencation method from CakepHP. When logging in I get the message in debug that the credentials are missing. In the request POST data the email and password fields are submitted. Am I missing something? /** *…
Mark
  • 41
  • 6
1
vote
0 answers

How to use htaccess to rewrite urls in cakephp?

I am new to cakephp and I want to change my project's admin from 'websiteurl/admin' to something unique and different as per client requirement. But the problem is that I cannot do that from routes file as it can create some issues in the project.…
1
vote
0 answers

How to insert data into multiple table simultaneously in cakephp 3.6

I'm trying to insert data into two table using association in cakephp but it was not workout yet. Controller: $payment = $this->Payments->patchEntity($payment, $this->request->data, [ 'associated' => [ 'ChequeDetails' ] ]); Model:…
JiNcy
  • 11
  • 2
1
vote
0 answers

CakePHP 3.6.x CSRF Token Mismatch

I am attempting to post an AJAX request to a controller method... I have done the following per the instructions on https://book.cakephp.org/3.0/en/controllers/components/csrf.html#csrf-protection-and-ajax-requests public function beforeFilter(Event…
Jeffrey L. Roberts
  • 2,844
  • 5
  • 34
  • 69
1
vote
1 answer

CakePHP 3 routes when using separate Controller namespaces

This question concerns routing (config/routes.php) in CakePHP 3.7.3 I have an application which uses 3 Controllers. Two of these are within an 'Admin'…
Andy
  • 5,142
  • 11
  • 58
  • 131
1
vote
1 answer

BelongsToMany associated record won't save in join table

I have 2 tables "Descriptions" and "Phases", associated BelongsToMany using a join Table "DescriptionsPhases", as per Cakephp naming conventions. I've been struggling with this for the best part of a day now: I just cannot get the controller to save…
Nigitch
  • 23
  • 2
1
vote
1 answer

'type'=> 'datetime-local' in cakephp 3.6

I'm trying to use 'type'=> 'datetime-local' in my form to create the date time picker. In the view everything works fine but cakephp can't handle the format of the result. I've tried to cast it to a Cake\I18n\Time but it ignores the set time and is…
virido
  • 41
  • 1
  • 2
1
vote
1 answer

CakePHP 3 bake model with same table name from different datasource

I'm using CakePHP 3. I have different sources to use and each having a different users table. In short, I'm creating a master panel to manage users from all other applications. When I bake users table from a different connection bin/cake bake model…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
1
vote
1 answer

Can I set default number format for specyfic table column in CakePHP?

I just started messing around with CakePHP. I have a table metrics and a column data_multiplier. I have baked all code for that table. Generated template produces something like this: Number->format($metric->data_multiplier)…
Kamil
  • 13,363
  • 24
  • 88
  • 183