Is there a way to check if a cakePHP action is b开发者_JAVA技巧eing called from an swf/flash movie like there is for Ajax using the requestHandler?
Put a named parameter in the URL that Flash is requesting:
eg. http://www.example.com/controller/action/flash:true
Check for this named parameter in your controller (or AppController) code:
if (isset($this->params['named']['flash'])) {
...
}
I don't believe so. A better option might be to create discrete controller actions that you only use from your Flash app.
Not the way I think you mean. The requestHandler
can detect the type of request, but I think you're looking for the request source. It might be worth trying the getReferrer()
method, but you may end up needing to add a click handler to the swf (if it's yours and you have that access).
精彩评论