Articles tagged with Element

Ajax elements available anywhere

By Sami Radi

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.

[Read more]

Attachments

By David Persson
Even though there are already good solutions out there this project tries -as usual- to make things even a bit better and to provide a documented, easy to setup and use, extensible, clean implementation of the functionality described in detail below. Plus: It should work and integrate well into the framework everyone of us loves so much.

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.
[Read more]