Welcome Guest, Not a member yet? Register   Sign In
Json Handling in ViewCI
#5

(01-18-2017, 05:00 AM)Diederik Wrote: http://lmgtfy.com/?q=jquery+json+decode

Thank You... its  appreciated

well i have found out to handle it just did the chnages in controllers and view

controller ->

$content = file_get_contents('http://wordpress-34240-73651-202010.cloudwaysapps.com/wp-json/wp/v2/posts');
      
 $content=json_decode($content,true);
 
 $data=array('decodes'=>$content);
  
$this->load->view('post',$data);

and in view i handled it like this

<?php foreach ($decodes as $decode) : ?>

  <tr>
   <td><?php echo $decode['title']['rendered']; ?></td>
   <td><?php echo $decode['date']; ?></td>
   <td><?php echo $decode['content']['rendered']; ?></td>
  </tr>
<?php endforeach ?>
Reply


Messages In This Thread
Json Handling in ViewCI - by shakeelahmed.cfs - 01-18-2017, 01:21 AM
RE: Json Handling in ViewCI - by neuron - 01-18-2017, 01:31 AM
RE: Json Handling in ViewCI - by shakeelahmed.cfs - 01-18-2017, 02:49 AM
RE: Json Handling in ViewCI - by shakeelahmed.cfs - 01-18-2017, 05:08 AM
RE: Json Handling in ViewCI - by Diederik - 01-18-2017, 05:00 AM
RE: Json Handling in ViewCI - by shakeelahmed.cfs - 01-18-2017, 05:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB