May 122010
 

Preface

I have yet to run across anyone in the Google search result world that is running a CakePHP application that contains multiple sub-applications. I have been developing multiple web-based applications in CakePHP that all reside in a single virtual host. The “master” application controls access to these applications. Each application is a sub-directory of the master APP/webroot (actually contains symlinks pointing back to the applications’ APP/webroot and Apache +FollowSymLinks).

Problem

My Session->flash notices do not work when I call a redirect within these sub-applications. If I do NOT redirect, then the flash appears as expected. The moment I redirect, it’s gone. Continue reading »

May 112010
 

Problem

I recently ran into an issue where I found it much more efficient to write a custom query to gather the data I needed to perform some processing than it was to utilize CakePHP’s model/controller normal data accessing functionality.

At first, I wanted to make sure that all of my related tables gathered all of the data from each other. This created numerous objects filled with data that I may or may not use. It also resulted in the need to loop through every array multiple times to gather the final data required.

So, I decided to make a custom query  in the model that would handle joining all the tables into one array. I ran into trouble where fields were being grouped into their respective models as expected by CakePHP’s model class. This caused a headache to access the data properly again. Continue reading »