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...
Selected posts
CakePHP 2.x Reducing Database Column Sizes by changing from TEXT to VARCHAR Column Types
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...
![CakePHP – SQLSTATE[HY000] [2002] Permission denied](https://toggen.com.au/wp-content/uploads/2017/06/Screenshot-from-2017-06-28-15-38-42-1080x675.png)
CakePHP – SQLSTATE[HY000] [2002] Permission denied
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...
CakePHP 2 – Dynamically Globally Changing the Database Connection
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');...
Making Weird Grunting Noises with CakePHP 3 & Twitter Bootstrap
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...
CakePHP POST Failing
I was just trying to submit about 10 x 15 records... and found that cakephp was failing with a validation error. Found out it was due to the following in the php error log. [09-Jun-2016 19:16:22 Australia/Melbourne] PHP Warning: Unknown: Input variables exceeded...
CakePHP 3 – Escape to the Global Namespace
This code in CakePHP 3: <?php $date = '31/01/1973'; $ymd = DateTime::createFromFormat('!d/m/Y', $date)->format('Y-m-d'); Causes this error Error: Class 'App\Controller\DateTime' not found This code fixes it: <?php $date = '31/01/1973'; $ymd =...
CakePHP 2 Slightly Better Looking than Default Pagination
Just trying to make my pagination in CakePHP 2 better looking. I added the first and last links but still had a radius on my previous and next links which looked odd and my 'last >>' link had a square end too. So a bit ugly really. Following is an example of...
Don’t look at me I’m hideous – It’s about CakePHP Y’all
How I got into this mess This is what happens when you are learning. Using the sample code from a CakePHP image upload tutorial Beginner getting debug output from PHP Scripts Couldn't figure out how to get meio_upload.php and PHPThumbs debug output to go to screen or...
Getting CakePHP working in your Home Directory
This presumes you know about the security implications of having pages served from you home dir and have taken appropriate precautions to stop unauthorized access: # add a new directory section to apache sudo vi /etc/apache2/sites-enabled/000-default Alias /mapp/...