4,463 questions
0
votes
1
answer
83
views
Vscode extension for cakephp import?
For instance I have the following statement,
TableRegistry::getTableLocator()->get('Users')->find()
Intelephense is showing, Undefined type 'App\Controller\Api\TableRegistry'.intelephense(P1009)
...
0
votes
1
answer
46
views
Unable to save data using HasOne association in Cakephp 4
I have tried to join two tables using hasOne association in my cakephp app
There are two tables users and admin. In both tables the id is primary key. i have linked the mobile field of admin to the ...
0
votes
1
answer
154
views
Alternative to $this->requestAction in CakePHP 4
In CakePHP 4, I've facing issue on $this->requestAction
I get an error which is error: [Error] Call to undefined method App\View\AppView::requestAction()
My Code:
<?php
if(empty($newsfeed) || ...
0
votes
0
answers
45
views
Modifying belongsTo contain condition on the fly?
What I have
In my OrdersTable.php:
$this->belongsTo('OrderStatuses', [
'foreignKey' => ['order_status_id', 'language_id'],
'joinType' => 'INNER',
'className' => 'OrderStatuses',...
0
votes
0
answers
86
views
CakePHP shows 500 Internal Server Error when project running locally then showing this type of error
CakePHP Version: 2.9
I Have set database in App/Config/database.php , when the project i am running locally then showing this type of error
my.htaccess file like below
<IfModule mod_rewrite.c&...
0
votes
0
answers
36
views
CakePHP authentication 3 quick start, does it actually create add.php?
Following the CakePHP authentication quick start guide, it ends with
You should now be able to go to /users/add and register a new user.
When I go to that URL, it says
The view for UsersController::...
0
votes
1
answer
29
views
Mixing values in `INSERT INTO ... SELECT` query
Say I want to insert a comment, the comments table needs a customer_id but I only have email. I do not want to select the customer in a separate query beforehand.
The INSERT INTO ... SELECT query from ...
-1
votes
1
answer
29
views
Where to locate code to be used by many Model->Tables. Can't find AppModel
Looking for AppModel to create a function that would be used by many different Tables.
Since AppModel doesn't seem to exist anymore, where do I put common functions for Tables, like I use ...
0
votes
0
answers
247
views
How do I upgrade version of cakephp2.0 to cakephp3 and cakephp4 step by step?
According to the topic, I want to upgrade the cakephp2.0 version to next cakehp3.0 version.
Change version as soon as possible. I have tried but there were change all the files of project and this ...
0
votes
0
answers
43
views
cakephp user saved but the save method returns false
after working with Cakephp for a while, I never had before an issue like this, I am struggling for a few hours and I cannot understand what is happening here. I will try to explain as better as I can:
...
1
vote
1
answer
308
views
Cakephp 3 Missing Route issue
I am working on CakePHP 3 web application in which routes are not working for root '/'. I have gone through several questions related to this issue but the issue is not resolved.
Below is the ...
0
votes
1
answer
44
views
Applying ucwords(strtolower(name)) to form data before submitting to DB in CakePHP
Assume a user fills a form and puts his name like AndReW(Mixed lower and uppercase), I want to get this form data, convert it to a form like this Andrew, and then submit it to the database.... I dont ...
0
votes
0
answers
51
views
I want to display product information by grouping them as one in cakephp
I have a product table with id, product_name and added_date.
I want to display product_name and added_date but I have the following condition to display the results
For product_name column: if ...
-1
votes
1
answer
624
views
How to create CakePHP project (previous version) using Composer (using an old version of PHP, in 2023)
TL;DR Technology moving on and what was deprecated is obsolete now. But fear not, Docker here to solve the problem. See the answer below to see how I create a CakePHP 3.6 project on macOS Ventura.
...
0
votes
0
answers
155
views
Loading JS files in CakePHP 3
I have a template inside a plugin in my project, that is trying to load a "general" JS file:
<?= $this->Html->script([
'base.js',
], [
'fullBase' => true,
]) ?>
...