Yesterday I had a very frustrating issue implementing CKEditor (an awesome open-source WYSIWYG editor) in a CakePHP 2.3.2 installation. I thought the issue had something to do with CakePHP … ow boy, was I wrong 🙂
If you want to achieve file upload validation trough your CakePHP model, you can use the following code. For this tutorial I you have a database table with a field ‘pdf_path’ (of course, this can be anything you like).
I’ve just upgraded my servers to PHP 5.4 and got this error when loading a project.
Declaration of MyModelName::beforeSave() should be compatible with Model::beforeSave( $options = array() )
There seems to be a problem when using PHP 5.4 and CakePHP 2.1 which results in this error. Since PHP 5.4
E_STRICT are now combined and with a default CakePHP installation error reporting is set to E_ALL & ~E_DEPRECATED!
Luckily it is really easy to fix!