• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Json Handling in ViewCI

#1
hey everyone .. I am a nwebiew to CI and a fresher too  neeed your help , 
I have a wordpress blog from where i have fetch posts through JSON and tat JSON data i want to view in CI VIEW 
i am sharing the code of controller 
Code:
<?php

class Code extends CI_Controller{

public function __construct()
{
    
    parent::__construct();
}    
    
    
    
public function test()
{      
        // echo "daewd"; die();
    //$otherdb = $this->load->database('blogs', TRUE); // the TRUE paramater tells CI that you'd like to return the database object.
      //$query = $otherdb->get('wp_users');
      //$data['wp_users']=$query->result_array();
      $data = file_get_contents('http://wordpress-34240-73651-202010.cloudwaysapps.com/wp-json/wp/v2/posts');
     $decode=json_decode($data, true);
      var_dump($decode);
       //print_r($decode['0']);  
      //echo implode(" ",$data);
      //print_r("<pre>");  
     // print_r($data['wp_posts']);      
    
    // $this->load->view('post',$data);
}    


    
}

so please tell me how i can show my posts and tiles of posts in the view
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.