开发者

cakephp requestHandler check for swf/flash

开发者 https://www.devze.com 2022-12-14 12:47 出处:网络
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 reques

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).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号