Questions tagged [cakephp-2.0]
Questions about the 2.0.x branch of the CakePHP MVC framework. If your question applies to CakePHP in general, use the tag [cakephp].
4,121
questions
-3
votes
0
answers
8
views
Not able to store data from registration form in ecommerce website
I am currently developing an ecommerce website during which I am facing issues in storing the data from the sign up page in database.
As I am currently working in cakephp 2 framework it automatically ...
1
vote
1
answer
34
views
Cakephp2.0 URL ID can be changed to user make it so its not allowed
contorller- this is part where i am trying to figure out
/form/edit/315 but i as a user can change to form/edit/316 and will see another users data.
if anyone can that would be much appreciated!
if ($...
0
votes
1
answer
26
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
1
answer
37
views
Undefinid variables in template - Cake PHP 2.x
I just migrate a cakephp 2.5 app to a server with PHP 7.2 (before server has 5.6 to 7.1), so I should update core (2.10) and finally get to show the app correctley but I'm having issues when urls with ...
0
votes
1
answer
20
views
How to link a custom CSS file in CakePHP2
How can I link a custom CSS file to my view in CakePHP2? I have a page that needs a unique css style and would like to know how to connect a custom stylesheet.
I've looked for an answer to this ...
0
votes
0
answers
18
views
Cake PHP 2.X User session stored in database expires even after giving timeout as 20 Minutes
I've a project running on Cake PHP 2.x. Recently I've changed the user login session from PHP to Database and set the time out duration as 20 Minutes. But the user gets logged out after inactivity of ...
0
votes
0
answers
16
views
Cakephp unique view counter
im trying to count the unique views based on the user how can i do it?
i tryed to do it like this
public function view_counter($id){
$this->loadModel('Visit');
$viewCounter = $this->Post->...
0
votes
0
answers
13
views
CakePHP 2: How to print SQL error for duplicate entries in the database
I want to print the exact SQL error on fronted for duplicate entries in the database table.
I have a table user( user_id (int) Primary key Auto_increament, username (varchar), user_code (varchar) ...
2
votes
1
answer
140
views
Retrieve total count of paginated records along side custom limit in Cake PHP 2 paginator
I'm working inside a legacy Cake PHP 2.10 application and am utilising both the Pagination component and PaginationHelper.
I've had to override the paginateCount method to set a custom option for my ...
0
votes
1
answer
34
views
Disable the URL query option from Cake PHP 2 paginator generated links
I'm using the Cake PHP 2 pagination to generate links in my view. The page URL I'm on is:
http://les-clone.ryan/payday_admin/leads
When I want to navigate forwards though my pages, Cake is adding a ...
0
votes
1
answer
34
views
Cake PHP 2.10 paginator not joining models
I'm trying to join my ApplicationPayday model to my Application in my Cake PHP 2.10 application via the joins property in my paginator. For some reason though, I'm only seeing the Application and not ...
0
votes
1
answer
32
views
Cake PHP 2.10 limit paginated model records
I'm working inside a Cake PHP 2.10 application and need to use the Cake paginator for my model to provide a paginated view for the end user.
The issue I'm facing is that I need to join other models to ...
0
votes
0
answers
26
views
convert cakephp configuration file nodejs configuration file
Currently my project is built in cakephp 2. I am moving stuffs to node.js from cakephp. I have a piece of code in core.php file. My core.php file includes these piece of code:
$bucket = env('...
1
vote
1
answer
55
views
how can I make same alignment for the input fields for all mobile devices in CSS
I am working on login page. For desktop and laptop devices it looks all good. In mobile devices, it looks bit different in different mobile device. For example, on iPhone 12 Pro the design looks good ...
0
votes
0
answers
71
views
Cake PHP 2 query count different between model and raw SQL
I'm working inside a legacy Cake PHP 2.10 project and need to get all rows from my Application model joining a few tables. When I perform the same query using Cake's query builder compared to raw SQL, ...
0
votes
1
answer
45
views
Unexpected cache in PHP class Cake PHP 2
I'm working in a Cake PHP 2.10 application, I have a PHP class called CommissionsConsolidationReport and I need to use the Cake PHP cache feature, but when trying to do Cache::read() and Cache::write()...
0
votes
0
answers
88
views
Cake PHP 2 join model method automatically via query
I'm working inside of Cake PHP 2.10 and have two models:
AffiliateId which has an aff_id column.
Commission which also has an aff_id column.
I'd like to join all of my commission data to my ...
0
votes
1
answer
50
views
Cake PHP 2 isn't joining linked hasMany relationships
I'm trying to join all AffiliateId models for each user through the Cake PHP 2 query builder, I'm seeing my users through the following query, but I get no affiliates despite there being affiliates ...
0
votes
0
answers
32
views
Only show models where linked relationship count is greater than 0 Cake PHP 2
I'm trying to only bring back users in my query where I have more than 0 AffiliateId models linked to it, I've tried the having option with a count of the model but it doesn't know what my column is? ...
0
votes
0
answers
25
views
Cake PHP 2 exclude all joined models and perform join on one model
I'm working inside of a legacy Cake PHP 2 web application that handles millions of rows of data. I have a model called Application which by default joins 7 hasOne relationships and 3 hasMany ...
0
votes
0
answers
92
views
CakePHP to Gmail Blocked
I'm having trouble sending emails to Gmail accounts through CakePHP 2 from a non-Gmail account. (EDIT)
Error code from Gmail:
550-5.7.26 This message does not have authentication information or fails ...
0
votes
0
answers
33
views
CakePHP 2 config URL - Resources loaded from wrong path
I have a CakePHP 2 source. I run it by using command php -S localhost:8000 on app/webroot folder (that means root folder is app/webroot). In app/webroot I have CSS and JS folders.
When I call ...
0
votes
0
answers
14
views
Xampp does not load css and js of CakPHP source
I put my CakePHP2 source into htdocs folder of Xampp (with name adv_sc)
I start Xampp and run http://localhost/adv_sc, there is no CSS and JS load for web
How can I do?
0
votes
1
answer
26
views
Cake PHP 2.x system logout after PHP upgrade
I upgraded PHP version to 7 for the system(cake PHP 2.x) few days back, I have mainly updated library files of framework. After it users are experiencing problem of logging out while they try to fill ...
0
votes
0
answers
15
views
How to pass parameter to new page on button click?
I need to redirect to new page on button click. This is the code I am currently using.
$(document).on('click', '#view', function (event) {
event.preventDefault();
let rowSelected = $(this)....
1
vote
0
answers
47
views
CakePHP 2.7 - changed server - issues finding Classes
Transferred an old CakePHP project to a new server to do some testing ( i don't have access to it's original server) . It's cakePHP 2.7 running on php 5.5. The project was originally built using PEAR, ...
0
votes
1
answer
70
views
I am developing a custom plugin in cake PHP 2.x, But I am not able to access it using it's routes
I have created plugin using it's documentation written in Cookbook.
cake bake plugin Mytool
And it does fine created a plugin named Mytool inside the app plugin folder.
Now created a controller using ...
0
votes
1
answer
162
views
PHP 7.1 usage with Traits in Cake PHP 2 application throws collision errors
I'm coding within a Cake PHP 2 application running PHP 7.1, I cannot upgrade the PHP version or Cake version due to business constraints, I'm building out a custom "module" system which has ...
0
votes
0
answers
56
views
Cake PHP 2 order model query results by array order
I'm doing some dev work in a Cake PHP 2 project. I have a model called QueueManagerJob and a column called queue, I need to be able to order the data retrieved on this model by the order of an array (...
1
vote
0
answers
64
views
Cake PHP 2 App::build() load CSS from custom module
I'm working on a Cake PHP 2 project that has a custom module system allowing for a folder within app called modules, and then each module can have Views, Controllers, Models etc... I've extended it to ...
0
votes
1
answer
87
views
Cake PHP 2 save data via model in Event Listener
I've got an event listener in my project's Lib/Event directory and a model called QueueManagerJob.
My application dispatches an event at some point and I'd like to save an entry into my database ...
0
votes
1
answer
191
views
Cake PHP run Console/command from within a module from root
I'm working on a Cake PHP 2 project and have got a custom module system set up that exists within app/modules/MyModule, within this directory I have folders such as:
Controller
View
Model
I've added ...
0
votes
1
answer
654
views
How can I use the environment variable in database.php file in CakePHP 2.x?
I am getting the below error while trying to use the environment variable in database.php file.
Fatal error: Constant expression contains invalid operations in app/Config/database.php
Note: I have ...
0
votes
1
answer
219
views
Cake php 2.10 login with http basic auth in controller action
I'm working on a legacy project built with Cake PHP 2.10 and need to conditionally utilise HTTP basic auth in one of my controller's action. It's currently set up to utilise the identify method with ...
0
votes
1
answer
56
views
How to display treeview in view using cakephp 2
enter image description hereHi guys i have problem to display treeview display in cakephp 2...using same table as parents and child as relationship.
Table MediaDirectory
id
Title
Parent_id
1
Test 1
...
0
votes
0
answers
118
views
htmlspecialchars to escape SQL string for Cake PHP 2
I'm performing an SQL query in my Cake PHP 2.10 application and need to insert a value that's retrieved from another query. I've been reading the docs for Cake 2 and came across this note:
If you use ...
1
vote
0
answers
43
views
Cake PHP 2.10 inner join on model retrieving data missing?
I'm working on a project that's written in Cake PHP 2. I have a model, which by nature uses the belongsTo association to pull in another model, but when I do my query, I need to be able to do an inner ...
0
votes
0
answers
91
views
Cake PHP 2.x model validation returns error on field despite data set
I'm working with a Cake PHP 2 project and am utilising the model validation and have implemented validation into my controller
I've set up my model to contain a $validate array with my fields and some ...
0
votes
1
answer
122
views
Cakephp Admin Prefixed Routing
In my Cakephp application i wish to have the following url:
admin/users/:action
I want the UsersController to reside in an sub-folder of Controllers named 'admin'. I know how to implement this with ...
0
votes
1
answer
118
views
CakePHP LEFT JOIN sorting issue
I'm using cakePhp 2.x version and following is my view and controller for a datagrid, I want Area and Boxes both to be sorted by user. Box can be sorted, but Area first sorting is working, after that ...
2
votes
0
answers
789
views
Upgrade CakePHP 2.X to 4.X
I'm trying to upgrade CakePHP2.x TO CakePHP4.x, I have WAMP 3.2.3 and Php 7.4. Downloaded CakePHP4.X but the entire directory structure is different between CakePHP2 and 4, if anyone share some idea ...
0
votes
1
answer
184
views
CakePHP flash messages triggering late
I have a CakePHP 2.5.1 website (although I've tested with an updated 2.10.18 version) running on PHP 5.3.29 (I know, old stuff).
The issue I'm having is that flash messages, seemingly at random (but ...
0
votes
0
answers
47
views
How write mysql sub query in cakephp2.4
I am developing a chat script in cakephp2.4 and in that i am facing some complex sub query issues, basic join query and other conditions are easy to work, when it comes with complex sub quires for ...
-1
votes
1
answer
468
views
CakePHP 1.3 migration To 4.x
Hello I need Some Help ,
I Have a CakePhP Project in version 1.3. I want To migrate in to 4.x is it possible and can anyone Help
what are the steps to follow to migrate from 1.3 to 4.1 CakePhp version
0
votes
0
answers
671
views
How to use PhpSpreadsheet in cakephp2
I Tried Many Thing To Implement PhpSpreadsheet in CakePHP 2.x , In CakePHP 4 It Worked For Me.
Finally I Tried things mentioned in given link blog
http://abakalidis.blogspot.com/2018/08/how-to-use-...
0
votes
1
answer
793
views
Call to undefined method Redis::delete() on CakePHP 2.10.24
I'm running an application on AWS Elastic Beanstalk PHP 7.3 running on 64bit Amazon Linux/2.9.12 and I've recently starting getting the following error -
Call to undefined method Redis::delete()
I ...
1
vote
1
answer
17
views
order by StudentId in query using cakephp
hello i am trying to order data through query.
i checked many documentation but their having DESC and ASC.
i want order through my decided number like.
$bb = $this->StudentsTest->find('...
0
votes
1
answer
277
views
Issue with concurrent requests in CakePHP 2.0
Thanks in advance for attempting to asssist me with this issue.
I'm using CakePHP 2 (2.10.22).
I have a system which creates applications. Each application that gets created has a unique application ...
0
votes
0
answers
88
views
Making cakephp 2 web secure not to be detected as "less secure app" by Google
I have a cakephp 2 web in which I want to send a confirmation email, but this action ends up falling in "SMTP server did not accept the password" error. I have read this issue may be cased ...
0
votes
0
answers
81
views
Using JavaScript session in CakePHP 2
i'm trying to use Session created in javascript in controller in CakePHP 2. I create session like this:
sessionStorage.setItem('language', document.querySelector('select#langSelect').options[document....