• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Codeigniter WebService library

#1
Webservice library is a Codeigniter Class that let you to make json and xml webservices + RSS
its very simple and easy to use .
Download version 1.0.0 , from Github OR Mysite


How to install codeigniter Webservice?

downlaod Webserivce from git and paste file in ypur codeigniter libraries folder ,
open your controller and paste this function in it




PHP Code:
public function service()
 
    {
 
    $this->load->library(array('webservice'));
 
     $data=array();
 
     for($i=0;$i<100;$i++){
 
         $data[$i]["Random"]=rand(0,1000);
 
         $data[$i]["Name"]=rand(0,1000);
 
     }
 
 $rss=array();
 
 for($i=0;$i<100;$i++){
 
     $rss[$i]["title"]=rand(0,1000);
 
     $rss[$i]["link"]=rand(0,1000);
 
     $rss[$i]["description"]=rand(0,1000);
 
 }
 
   $this->webservice->getData($rss);
 
   echo $this->webservice->json();   //Create Json 
 
   echo $this->webservice->Xml('root'); //Create XML with root node start
 
   $info=array(
 
     "title"=>"Sample Feed - Favorite RSS Related Software & Resources",
 
     "description"=>"Take a look at some of FeedForAll's favorite software and resources for learning more about RSS.",
 
     "link"=>"http://google.com",
 
     "copyright"=>"Copyright 2004 NotePage, Inc."
 
  );
 
  echo $this->webservice->Rss($info);

Reply

#2
Hey buddy, good effort! I really recommend adding some tests to your library though, I'd think most would be afraid to put anything without tests in their application.
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Reply

#3
(02-19-2017, 10:36 AM)albertleao Wrote: Hey buddy, good effort! I really recommend adding some tests to your library though, I'd think most would be afraid to put anything without tests in their application.

sure. i will do it . thanks for your idea   Heart Heart
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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