Here’s an example of CakePHP Containable behaviour. Although, it was not a very complex find call but the beauty of the containable is this that you can fetch records using “tricky ways” which normally may not be possible with straight…
Month: January 2015
How to uninstall a program from command line
My Windows 7 operating system asked me to update my skype installation. I did follow update instructions but the upgrade failed. It however was a usual message in which Skype installer had detected an old installation of Skype. Hence it…
WordPress uploads issue files with php in the name are blocked!
iThemes Security (formerly Better WP Security) has implemented some rules to prevent unwanted actions on your WordPress website. One of these Rules is to prevent php execution in side “uploads” folder. The line which is supposed to do it is…
How to paginate a different model with options in CakePHP
Assume you are on a LogsController which has Log as the default model and wanted to paginate another model LogColumn. Here’s How it goes:
How to get model name from controller in cakephp
Suppose we have $controller as an object for our controller class. We can do the following to get the model class: [code]$modelName = $controller->modelClass;[/code]