CodeIgniter Forums
Codeigniter WebService library - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: External Resources (https://forum.codeigniter.com/forumdisplay.php?fid=7)
+--- Forum: Addins (https://forum.codeigniter.com/forumdisplay.php?fid=13)
+--- Thread: Codeigniter WebService library (/showthread.php?tid=67410)



Codeigniter WebService library - nima-habibkhoda - 02-19-2017

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);




RE: Codeigniter WebService library - albertleao - 02-19-2017

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.


RE: Codeigniter WebService library - nima-habibkhoda - 02-19-2017

(02-19-2017, 09: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