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. Continue reading
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 in first code snippet below) but down the road some times later Continue reading
I was making a url route like this:
Router::connect('/ca/assets', array('plugin' => 'file_manager', 'controller' => 'file_manager', 'action' => 'assets', 'ca'));
It worked alright with normal urls as- /ca/assets. However when i used paginator in view as
it generates url as- /assets/ca/page:2
I tried different things and at the end, as a work around to this problem I figured out that the following trick works. So make some heck in the $this->Paginator->options() function as the following:
$this->Paginator->options(array( 'url'=>array('controller' => 'ca', 'controller'=>'action', 'plugin'=>false) ));
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. Continue reading
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 as compared to my application in my local machine. Continue reading
As you know one would generate the cakephp table schema as:
$ cake schema generate
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.
I am in a Task model.
I build following options to load the Task and associated User model data. Continue reading
I have a database table field defined as decimal(10,5). I want to use it for various purposes so I don’t want to change the datatype. In most of the forms however I want to keep this field showing none or very limited number of decimal points. Continue reading