Articles tagged with "controller"

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]

Force login on Ajax requests

By Michal Szajbe
Users often encounter situations when they want to perform an action on a web site and get redirected to login page. Application’s task is to take care of performing the requested action right after user’s successful log in. It is easy job, unless the action is requested via ajax.
[Read more]

How to create an XML-RPC server with CakePHP

By Filippo Toso
This tutorial describes a method to create an XML-RPC server that goes a bit against Cake’s logic and conventions.
[Read more]

Automatically load all controllers and actions into ACO tables for ACL with a CakePHP Task

By Barry
If you've spent anytime wanting to use ACL on your applications, you know how tedious it can be to manually enter your entire controller and action structure. This Task will handle finding and loading or updating all of those for you whenever you run it from the command line.

There isn't a section for Shell/Task code so I figured plugins was the place to go.
[Read more]