Migrations is a powerful feature in CakePHP. It gives you a tool to create or import database structure and data through command line interface. CakePHP Migrations is installed by default when you install CakePHP.
Tag: CakePHP
CakePHP captcha support for CakePHP 2.x and 3.x
Here is the latest CakePHP Captcha support for CakePHP Version upto 3.x. Download for CakePHP 3.x Download for CakePHP 2.x NOTE:For best Image Captcha results this component requires GD and Freetype support enabled. Please check your phpinfo() to know whether your server…
Saving multi-level associated data in CakePHP
In CakePHP 2 we had hasMany, saveMany, saveAssociated model methods or functions to save associated data. These functions works great with straight associations but to make them work for saving multi-level association data you need a trick.
Gmail SMTP in CakePHP not working? Here is a possible fix!
While working in a CakePHP application in my local computer I usually use Gmail SMTP in CakePHP to send emails from my application which are of course test emails. Previously it worked just fine with the basic settings (as specified…
How to set Cakephp paginator url for custom Route
I was making a url route like this: [php]Router::connect(‘/ca/assets’, array(‘plugin’ => ‘file_manager’, ‘controller’ => ‘file_manager’, ‘action’ => ‘assets’, ‘ca’));[/php] It worked alright with normal urls as- /ca/assets. However when i used paginator in view as [php]echo $this->Paginator->numbers();[/php] it generates url…
jQuery File Upload plugin for CakePHP 2.x
Got a working copy of https://blueimp.github.io/jQuery-File-Upload/ file upload plugin for CakePHP 2.5.5 built as a plugin. Forked and modified from the original repository https://github.com/hugodias/FileUpload into https://github.com/inimist/FileUpload to incorporate latest files and functionality.
CakePHP: switching between multiple databases
Relating to a post I submitted a while back, along with creating a data connection on the fly I had to switch between two connections. That is, file based default connection and a dynamic connection based on user. Here is…
Remove remote directory from repository after adding it to .gitignore
I had a directory named sites added to my git repository. As it contained a bootstrap file having names of each new domain in multiple sites setup hosted in the single CakePHP application it contained different domain entries and folders…
Cakephp generate plugin schema
As you know one would generate the cakephp table schema as: $ cake schema generate
CakePHP Create Datasource on the fly
Want to switch between different databases in a CakePHP action? Do you want to use different database for different clients or sites? Don’t worry the solution more simpler than you thought it to be. Following this link and few other similar…