开发者

Embedding existing page in a CakePHP site

We have an existing PHP page (from an earlier 开发者_运维技巧project) which could be described as cryptic and ancient. It basically displays a form, catches the input and runs an external application to process the input and then pipes the output to the user.

I would really like not to modify this file any more than is required. Would there be an easy way to just make this file magically work by copying it to some location in the CakePHP's directory and have it receive $POST etc. as usual?


Given that this is a simple form you described, I would simply move that form to a view, handle the post in a controller (possibly converting cake's POST data to your form's "old format" and "forwarding" it to the old page code). You could then redirect to a result page or just output it in the same view. It could be a simple copy-paste job, but only you know if that's true. But if it is really that simple, a conversion is due ;)

I'm afraid there is no way do just "plug it in" and have it working, or at least I'm not aware of any way to do that.

Unless you're willing to leave that form in your /app/webroot and keep it separate from the rest of your app? Anything placed there should be left alone by cake, so I guess that would work..?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜