Articles tagged with Element
Ajax elements available anywhere
When I have chosen to work with Cakephp it was because of all these great features that we could use to create an ajax app easily. However, I had some problems to manage Ajax view elements like header, footer,... I figured out a solution that I would like to share with the community and have feedback about. (p.s : forgive me for my english, i'm not a native speaker)
Here's an overview of the problem. Ajax key feature is to smooth the user navigation by preventing page reloading through ajax requests. Let's say that you want to put an Ajax login into your website header. You need to be able to use the feature anywhere on the website.
After hours of readings i found out that to be compliant with cakephp MVC structure the process should be the following :
- 1. Ajax call to current controller.
- 2. request requested action from this controller or another controller.
- 3. proceed with your algorithm.
- 4. setting the values into the view that has to be rendered.
- 5. render the view or element.
- 6. end of Ajax call.
Attachments
Parts of the code is based upon or inspired by `Improved Upload Behavior` by Tane Piper, `ImageHelper` by Jon Bennet, `Attach This!` by Alex McFadyen and `Generic Upload Behavior` by Andy Dawson.
Latest Comments