Suspected Caching Issue with CakePhp 4

I’m recently getting back into programming after taking a break for quite some time. I’m currently trying to rebuild my CakePhp 2.X apps for CakePhp 4.X. I’m developing in a local environment using Bitnami WAMP stack. The issue is that development is very slow because changes do not seem to be taking effect immediately. I… Read More Suspected Caching Issue with CakePhp 4

Cakephp api POST request , saving data without validation

I have created a route with Api prefix $routes->scope(‘/api’, function (RouteBuilder $routes) { $routes->setExtensions([‘json’]); $routes->post( ‘/add-categories’, [‘controller’ => ‘Miles’, ‘action’ => ‘addCategories’,’prefix’=>’Api’] ); } I have created a controller file in directory Controller/Api/MilesController.php I have created a addCategory method like below public function addCategories() { $categoriesTable = $this->fetchTable(‘Categories’); $categoryEnt = $categoriesTable->newEmptyEntity(); if ($this->request->is(‘post’)) { $category… Read More Cakephp api POST request , saving data without validation

Form::setData([]) to remove input values of a contact form after sending email not working in CakePHP?

I’ve created a contact form in Cakephp 4 refering to the doc (https://book.cakephp.org/4/en/core-libraries/form.html). I have a problem to remove input values after the email has been sent. Here’s my ContactController.php : <?php namespace App\Controller; use App\Controller\AppController; use App\Form\ContactForm; class ContactController extends AppController { public function index() { $contact = new ContactForm(); if ($this->request->is(‘post’)) { if… Read More Form::setData([]) to remove input values of a contact form after sending email not working in CakePHP?