Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8367241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:06:36+00:00 2026-06-09T13:06:36+00:00

We have a web app (let’s call it widget app) that contains data I

  • 0

We have a web app (let’s call it widget app) that contains data I need to integrate with a new Codeigniter app that I’m building.

I have a controller called objects and lets say it will have a method called getallobjects. This method actually has to return data from the widget application.

There is an “API” of sorts for the widget app, but the way that I call it in a RESTful way by getting a URL like:

   http://myserver/widget/abc.php?method=getsomething

This returns a bunch of json encoded data.

How would I use this type of an API in my MVC CI app?

So far, this is what my controller looks like:

 class Objects extends CI_Controller {
     public function __construct()
     {
         parent::__construct();
         $this->load->helper('url');
     }

     public function getallobjects()
     {
         $data['objectlist'] = ????/* This is where I need to call the rest api and get json data. */

         $data['main_content']='objects';
         $this->load->view('includes/template', $data);
     }
  }  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:06:37+00:00Added an answer on June 9, 2026 at 1:06 pm

    you can call file_get_contents($your_url)

    http://php.net/manual/en/function.file-get-contents.php

    to fetch the response.

    Additionally you can use php curl wrapper for finer control over your request.
    http://php.net/manual/en/book.curl.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web app that reads data from a SQL DB that contains
I have a web app that displays the details of some entity, let's call
I have a web app that has to do something every, let's say first
Let's say I have a web app that calls out to a native app
I have a web-app (let's call it app1),in which I can't even see the
In a webapp, i have a data-model (let's call it Item). The data of
I have a web-app with a Java back-end that uses Tomcat jdbc-pool for database
I have a web app that runs fine in Visual web developer. But when
I have another web app, that uses the liferay user database. But before a
I have a web app that is supposed to be run on a single

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.