I want to change the name of a column in my database and to do that I have to create a migration and drop a table The query I want to run is UPDATE pallets SET production_date = print_date; Seem so simple in SQL but to do it in CakePHP 4 took some finding Copy data...
So recently my code editor has been putting a line through File because it is going to removed in CakePHP 5 So here is an example of code that uses the deprecated methods and the suggested SplFileObject Using File public function createTempFile($print_content,...
Just had a situation where I couldn't get a redirect to work. My CakePHP app is in an Apache enabled docker container behind an nginx reverse proxy $this->redirect($this->request->referer()); The above simply refused to work in my development environment it worked...
I have the need of creating a page with multiple forms on it that have 'copies' and 'printer_id' fields on them. Each form has, or might need separate validation values. My first attempts ended up with the other form with the same field names getting the values from...
A recursive function that takes a validation error array and return a string with all the different errors concatenated into a formatted string Further to my previous posting https://toggen.com.au/it-tips/cakephp-2-displaying-validation-errors This function will walk...
Some small changes from the old CRA version 2.x the asset-manifest.json now has an entrypoints key // view code src/Template/Assigned/schedule_edit.ctp <?php foreach ($css as $style) : ?> <?= $this->Html->css('/react' . $style, [ 'block' => true ]); ?> <?php...
I was using a TEXT database field for some text settings and found that it uses 64kb of data SELECT name, char_length(comment)/1024 FROM settings; Checking the field size with the above query I found that the largest content was 0.6660 kb. So I had specified a...
Just saw this error and usually this is due to having a misconfiguration in the database connection options. But I am running Fedora 25 with seLinux enabled by default. First to test if it's seLinux causing an issue If...
Dynamically Globally Changing the Database Connection in CakePHP 2.x I use this code in app/Model/AppModel.php to dynamically change my database environment in CakePHP 2.x depending where it is running <?php //app/Model/AppModel.php App::uses('Model', 'Model');...
This is how I got grunt running with the twbs/bootstrap plugin to automatically copy the CSS, JS and Fonts into my CakePHP 3 development environment. I did this on MacBookPro OSX 10.11.5. But this applies to Linux too. If anyone has better suggestions as to how this...
James is an IT Professional based in Melbourne, Australia.
He blogs about Information Technology, Open Source software, home renovations, good reads and travel.