How can i perform a GET request from a separate php file to a uri in my cakephp platform
I'm new with cakephp and I've just finished putting my controllers, models and views in place.I am able to get information from my database through the browser, but i want to achieve this开发者_C百科 using a seperate php file where i perform a get request. How can i perform a GET request from a separate php file to a uri in my cakephp platform?
I am not sure if this is what you want to accomplish but,
If you want to get the output of your views from another php file (script?), you could use file_get_contents($url)
, where $url
is the uri to your cakephp app.
Hope this helps
If I understand what you mean: Its pretty easy.. add params to the end of your uri: like this yourdomain.com/controller/action/99/foobar
This adds an id and some random param which you can use in your controller with the code below... Just add them as params.
function action($id,$param2){
// use params here
}
精彩评论