Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
who to get HMVC result in Array
  • in HMVC how to get the value result in array i have function in controller which return a array ,
    but when the it reach view the array is converted in some think else their is some parameter include to it lie given below 
    Fuel\Core\Request Object ( [response] => Fuel\Core\Response Object ( [status] => 200 [headers] => Array ( ) [body] => Array ( [0] => Array (

    how to get the body value from this array
  • HarroHarro
    Accepted Answer
    The Request object has a method called response() to fetch the response after execution. The Response object has a method called body(), which you can use to retrieve the response body.

    So:

    try
    {
        $body = Request::forge()->execute()->response()->body();
    }
    catch (\HttpNotFoundException $e)
    {
        // the URL of the HMVC request does not exist, handle it to avoid breaking the app
    }
  • thank u very much

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion