Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
i want to use json in nomar controller not Controller_Rest
  • how can i do?
    incontroller
    $post->$vo['name']   = json_encode($fields[$vo['name']]);
    
    but view
    json_decode
    
    not work
  • function json_encode($data=array(),$response=200)
     {
      $content_type = array('Content-type'=>'application/json'); 
      if($data) 
       return new \Response(json_encode($data),$response,$content_type);
     }
     
     function json_decode($data=array(),$response=200)
     {
      $content_type = array('Content-type'=>'application/json'); 
      if($data) 
       return new \Response(json_decode($data),$response,$content_type);
     }
    
    not work

Howdy, Stranger!

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

In this Discussion