What is the best way to list the top occurrences of a value in a table using CakePHP (v3.X)? For instance, how can you display the 10 most common first_name values from a table called Users? Instead of using raw SQL like the example below, is there a mor ...
Calling all angularjs experts for assistance... Currently integrating cake with angular. Utilizing a rest controller to enable communication and retrieve options in a serialized json format as displayed below Attempting to populate dropdown options: &l ...
I am currently developing an application using CakePHP, JQuery, and Mysql. On my homepage, I have a list of all the form names. When a user clicks on a form name, it should display the form. In the view for each form, I have the following code: <?php e ...
I recently came across a feature in the CakePHP Book where you can create your own customized setFlash messages using an element. However, I'm unsure of what to include inside the element and how to pass different content. For instance, let's sa ...
The challenge Upon login, users are presented with a list of tasks they need to complete. I am looking for a way to filter these tasks based on assignment. The key fields in the table include: **tasks table** task_id | (Foreign Key int) user | (Foreign ...
Managing data through passing IDs in URL format like /apis/view/id.json allows me to view and delete data. public function view($id) { $api = $this->Api->findById($id); $this->set(array( 'api' => $api, ...
In my cakephp application, there is a database table named users containing user data. Each user record includes the registration date stored in a field called date. I want to perform a find query that retrieves all users who registered last month. Here's ...
I'm struggling to locate any references on this topic. My challenge involves a webpage that showcases a list of users. Above the list, I can successfully update the user information using ajax. Once updated, I need the table below to reflect these ch ...
Currently, I am attempting to implement alphanumeric with spaces validation in CakePHP 3.5.13. To achieve this, I have made the following addition to one of my Table classes: // src/Model/Table/SavedSearchesTable.php public function validationDefault(Va ...
I have been working on a CakePHP web application and have created a small Ajax function in the default CTP file setup. I am now trying to send value data to another controller function. In the Chrome browser network, it shows that Ajax is posting to the de ...
I created a web application using cakephp on my Windows XP system with xampp, and everything worked perfectly. However, when I deployed it to a CentOS and an Ubuntu Server, I encountered a strange issue. The problem is that there seems to be a tab space ad ...
Router::connect( 'mylogin', array('controller' => 'User', 'action' => 'xyz', 5) ); Is there a method for transforming the string '/User/xyz/5' stored in a database into an array array('controller' => 'User', 'action' => 'xyz', 5)? Is ...
Imagine a scenario where two models are associated, with the main model having a hasMany relationship with the other model. For example, Donor hasMany Donations. After carefully studying CakePHP's documentation, I came across this important note: "When ...
Having difficulty posting and retrieving JSON data using CakePHP. In the view file, attempting to post data with code resembling the following: $.ajax({ type: "post", url: '/invoices/insertItem/', data: {'description': "this is description", ...
I recently followed a tutorial on setting up a REST webservice for JSON and XML. While XML outputs correctly, I encountered an issue with JSON calls which resulted in the "view not found" message from Cake. To address this problem, I made some modificatio ...
Is it possible to use JavaScript to read an Excel file and convert a single column (identified by name or index) into an array in JavaScript? ...
After exploring various options, I came across an interesting article stating that php applications can actually be deployed on Google App Engine using Quercus. This has raised a curious question in my mind - Can cakephp applications also be deployed in a ...
In my work with CakePHP, I encountered an issue while creating a form that includes file uploads along with textboxes and textareas. My HTML code for the form is structured as follows : <form action="" id="frmReg" method="post" enctype= "multipart/for ...
I'm currently facing some challenges while trying to validate an I18N field in CakePHP3. The setup for the translate behavior looks like this: $this->addBehavior('Translate', [ 'fields' => ['name', 'body ...
In my index.ctp file, I am attempting to determine if a date is more recent than one week ago: (((!isset($task->date_end) || is_null($task->date_end))? strotime('now') : $task->date_end) > strtotime('-1 week')) However, I am encounte ...
Could someone offer some help with cakephp? I'm experiencing an issue related to routes that I can't seem to resolve. I've organized all my css files in webroot/css within my app. In my default layout, I included a html link <link href="css/bootstrap.m ...
Is there a way to incorporate the COALESCE() statement directly in the query builder? SQL SELECT COALESCE(n.value, p.value) AS value FROM nodes n LEFT JOIN parents p ON p.id = n.parent_id PHP I am currently retrieving both child and parent values separ ...
Server Configuration: MySQL 5.1.73 Apache/2.2.15 PHP 5.6.13 CentOS release 6.5 Cakephp 3.1 I am facing an issue with an import process on the server. After approximately 4 minutes, the process stops abruptly without any error or warning messages in the ...
I'm having difficulty formatting the content retrieved from my Controller as JSON in my view. Instead of displaying neatly like a typical JSON output, mine appears messy and unorganized. When I search for JSON online, I see outputs that look like thi ...
I'm struggling with implementing a feature in my form where user-submitted data needs to be manipulated based on specific conditions. Depending on the field, I want to either ignore the data, divide it by 100, or multiply it by 1,000,000. While tryin ...
I am currently using CakePHP 3.6 and have implemented a function that retrieves data via an AJAX call. This function can be triggered from any page on my website, where a button click opens a modal displaying the data fetched through the AJAX call. The iss ...
I recently created a web app using PHP MySQL in both plain code and also with CakePHP. Everything was working fine until I uploaded the Cake directory to an Ubuntu EC2 instance, which resulted in a 500 server error. I attempted adding / to all three htacc ...
I am facing a challenge in accessing the repository from a CakePHP project called fredistrano (which allows CakePHP deploys with a web 2.0 interface). The issue arises when I try to access fredistrano located in my web broadcasting directory on a shared Un ...
Encountered a 403 error when making an Ajax request in a Cakephp project. Despite having all permissions granted for the project directory in localhost (XAMPP). Error message: "Failed to load resource: the server responded with a status of 403 (Forbidde ...
After setting $this->layout = 'ajax', Cake still requires the view file for that action to be present. I'm wondering, is it necessary to create that view file, or is there a workaround? I want to avoid having one-liner view files for ajax actions like ...
I'm really struggling to figure out what's happening here! The jQuery doesn't seem to be working at all. Even though the script is being generated, when I click on the submit button, it behaves the same as if jQuery and Ajax weren't inv ...
I have set various view variables in my App controller like company name, address, and contact information that change depending on subdomains to make them available across all view templates. However, I am facing difficulties in understanding why they are ...
Currently, I am utilizing a jQuery .load() function to enable infinite scrolling in a CakePHP web application. Below is the snippet of Javascript code: $("#post_container").append('<div class="batch row" style="display:none;"></div>&apos ...
My MySQL RDS instance needs to be scaled. I am able to launch read replicas in Amazon RDS, however, there is an issue with write operations not functioning on read replicas. Is there a way to redirect all write operations (INSERT, UPDATE, DELETE) to the ma ...
I've been searching everywhere and unfortunately, I can't seem to figure out why the data is not being sent to my controller when posting via ajax. Here's the jQuery code snippet: var newDate = {}; newDate['start'] = startyear+"-"+startmo ...
I recently installed the Google PHP API Client library using Composer from this link: https://github.com/google/google-api-php-client After installation, the guzzle, psr, monolog, firebase, and google directories were generated in my vendor directory. Ho ...
Currently, I am trying to send email from PHP using the Gmail SMTP server. I had everything set up and working smoothly with SSL over port 465, but unfortunately, my web host does not allow outgoing traffic over this port. However, they did inform me that ...
Array ( [Page] => Array ( [id] => 1 [parent_id] => 0 [title] => example [url] => http://www.example.com [slug] => www_example_com ...
Seeking assistance on why the current code isn't functioning. The objective is to retrieve data from the index controller to search and obtain JSON data. No requests are being made, and there are no visible results. New to CakePHP 3.0, I am attempting to ...
Alright, I've been seriously bothered by this issue for the past couple of days. Let's take a look at my form: echo $this->Form->create(FALSE, array('id' => 'AdminGeneralReport', 'class' => 'Report ...
As a beginner in using cakephp, my goal is to display a list of all subjects belonging to a specific subject category. I have created a Subject model with the following code: subjects.php <?php class Subject extends AppModel { var $name='Subject'; va ...
I am facing an issue with implementing a password reset function for my CakePHP website. I have tried various methods such as $auth->hashPasswords, $auth->password, and even Security::hash, but none of them seem to be hashing the password correctly. ...
What I am searching for is: if I provide training_ids 172 and 174, it should only return user 150 I attempted the following query but it did not produce the desired result SELECT user_id FROM Training_users WHERE training_id = 172 AND training_id = 174 ...
Hey everyone, I'm relatively new to cakePHP and I've been struggling with a simple user registration feature. For the past two days, I've been stuck on validating the form. No matter what, the validation function always returns true, which means that even ...
I am having trouble calling the jQuery function mentioned below in my CakePHP3 MVC project. There are no error messages, but nothing seems to be happening. The code is set up so that jQuery gets included automatically. The function I am trying to call sh ...
$this->loadModel('Menu'); $this->loadModel('SubMenu'); $this->loadModel('SubSubMenu'); $options['joins'] = array( array('table' => 'sub_menus', ...
I am in the process of implementing a search functionality in my CakePHP 2.x project. Below is the controller code I have written: public function admin_index() { $this->Customer->recursive = 0; $this->Paginator->settings = array( ...
Encountering an issue with the AJAX call. Currently working on a website project in PHP using CakePHP framework, where a popup appears prompting the user to choose between "yes" or "no". Depending on the choice made, the selection should be saved. However, ...
$newContainer = $this->Containers->newEntity($this->request->data); if($this->Containers->save($newContainer) !== false) { $this->Flash->success("Saved"); } else { debug($newContainer); } Why does it always display the deb ...
Can the output of a treeList be sorted? $orgUnits = $this->OrganizationalUnits->find('treeList', [ 'keyPath' => 'id', 'valuePath' => 'name_en', 'spacer' => ...
While trying to implement the plugin friendsofcake/crud, version 5.4.1, on a fresh installation of CakePHP 3.5 with the Api, ApiPagination and ApiQueryLog listeners, I encountered an issue. My setup includes PHP 7.0 on Ubuntu. Following the installation i ...
I am currently using the CakePHP-Photo-Behavior from the repository https://github.com/dilab/CakePHP-Photo-Behavior and I encountered an error while running it. The error message states: SQL Error: 1054: Unknown column 'Array' in 'field list' [COREcakel ...
Currently, in CakeORM 3.2, the scenario involves an object named Cabinet, which possesses Siblings. These Siblings are essentially other Cabinets positioned similarly (meaning they share the same values for x, y, and location_id). Within the hasMany relati ...
My FQL result is a JavaScript object with the following structure: [{"name":"3904","fql_result_set":[{"like_count":"0"}]},{"name":"7617","fql_result_set":[{"like_count":"0"}]},{"name":"9674","fql_result_set":[{"like_count":"0"}]}] I am struggling to pass ...
Currently, I am utilizing CakePHP 3.3.6 along with MySQL 5.7.13. The database consists of several tables, including collections, tags, and the intermediary table collections_tags. Collections Table CREATE TABLE IF NOT EXISTS `database`.`collections` ( ...
I am currently in the process of developing a REST API using CakePHP. Essentially, when I send requests to endpoints like add.json, the input data is processed and a JSON response is returned. Similarly, if I send it to add.xml, an XML response is generate ...
I'm currently learning how to work with CakePHP, and I am encountering difficulties in adding a form that can post to a different database table using ajax. The form I have now successfully carries out a search, but before the user can perform the search, ...
Hey there, I've got a behavior that allows me to upload data from an Excel file to the model. The issue I'm facing is that when the data is invalid, I don't receive any errors - just a silent failure. I return a generic error message in this ...
My goal is to create a data saving functionality with a next button. After filling out the form, clicking on the next button triggers a popup dialog asking, "Do you want to submit your data?" To achieve this, I included the following code in my submit but ...
When using a select input with multiple set to true, how can I save this data in a cakephp-friendly way while also implementing validation? <?php echo $this->Form->input("user_id", array('multiple'=> 'checkbox' )); ?> ...
I am currently facing an issue with an AJAX call to a CakePHP function in the controller. The problem lies in the fact that after the controller function sends back a response, neither the complete nor success nor error functions are being triggered. Any ...
I am currently working with Cakephp 2.8.0 and I am facing an issue with implementing ajax in my application. I have a list of categories displayed as li links, and upon clicking on a category, I need to remove certain html code, locate the necessary catego ...
Recently, I have taken over a large code base that was developed by an external source for my company. The code is built using cakephp version 1.3.6. Running the application on a lamp server with php5.3.29 works fine. However, when I try to run it on a ma ...
I'm trying to retrieve data from the database and send it using Ajax in CakePhp4 from the controller to the view. Although I've managed to implement it (with sparse documentation), I'm facing an issue where it doesn't return me the array. It seems to be e ...
While working on receiving data, I encountered an issue where the saved time in the database is different from what was input. For example, when I send 8:00 pm, it gets saved as 12:00 am due to a +4 hour difference. When I receive data from a form and che ...
To ensure my CakePHP application is internationalized, I am setting the timezone for PHP and MySQL. When a client sends a request to the server, before processing the request, the server connects to a GeoIP location server to retrieve the timezone. I then ...
I'm having trouble creating an auto-refreshing DIV with updated data. Despite everything appearing to be correct, it's not displaying any results on the webpage. Any assistance would be greatly appreciated :) Controller: public function homeNewMessagesA ...
I need to arrange the table structure for product plans as follows: +------------------+---------------+---------------+ | product1 | product2 | product3 | +------------------+---------------+---------------+ | product1plan1 | product ...
I am struggling with the onChange event in this code snippet. I must have overlooked something because it's not functioning as expected. Can someone please point out my mistake? Your assistance is greatly appreciated: <td class="cellInput"> < ...
I'm working with a table that contains checkboxes. After selecting them, I want to calculate the sum of values from the table in a modal before confirming the form submission. Can someone guide me on how to render the AJAX response from the controller? Her ...
I am currently using CakePHP version 2.5.5 for my project located in the directory: C:\xampp\htdocs\vy\cakephp-2.5.5. The layout of my project directory is as follows: I have created a file named C:\xampp\htdocs\vy&b ...
If I have a selection list like the one below: <select name='languages'> <option value='german'>German</option> <option value='english'>English</option> </select> How can I use JavaScript/jQuery to refresh the ...
I have recently started working with CakePHP and I have a question about how PHP code is executed in a file with the .ctp extension. Can you explain how PHP is processed within a .ctp file in CakePHP? Additionally, I'm also curious about executing PHP co ...
Currently, I have a Users table with the following structure: |**id**|**username**|**password**|**role**|**email**| When creating an edit page for users to update their username/password/email, but not their role, I am using CakePHP's form helper. I ...
When I have two AJAX calls, the first one starts a long-running script and the second one polls a database table for a percentage field. Strangely, when making the second AJAX call, the database query will always return false until after the first one is c ...