CodeIgniter in PHP

6,421 views

Published on

Published in: Technology, Design
  • Great list. If you want the latest PHP interview questions and answers, you can check out the below slideshare as well

    http://www.slideshare.net/hirist/top-100-php-questions-and-answers
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • As a one PHP Developer, This information is very much useful for me. It will help me to get more knowledge about codeIgniter.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

CodeIgniter in PHP

  1. 1. Introducing CodeIgniter Framework in PHPIn this article you will see how use MVC in PHP through the CodeIgniterframework. CodeIgniter is an Application Development Framework - atoolkit. Using CodeIgniter you can develop projects much faster than withthe core PHP. The CodeIgniter framework is fully based on the MVCarchitecture. CodeIgniter lets you creatively focus on your project byminimizing the amount of code needed for a given task. You can downloadthe CodeIgniter framework from: "http://codeigniter.com/".How to Install CodeIgniterFirst of all extract the zip file of CodeIgniter. After extracting the CodeIgniterfile you will paste in the following position "c:wampwww" (paste) orc:xampphtdocs (paste).Set URL in CodeIgniterFor setting the URL in CodeIgniter go to the local disk C->wamp->www->CodeIgniter->open CodeIgniter->open application folder->open configfolder->open config.php file->write the following URL:$config[base_url]=http://localhost/CodeIgniter/;Creating the First Application in the CodeIgniter Framework<?phpclass Hello extends CI_Controller{ public function index() { echo "Hello Vineet !!"; }}?>This file is to be saved inc:wampwwwCodeIgniterapplicationcontrollershello.php. HereCI_Controller is the predefined class which is stored in thec:wampwwwCodeIgnitersystemcorecontroller.php. www.vineetsaini.wordpress.com
  2. 2. OutputOpen the web browser and write the following URL:"http://localhost/CodeIgniter/index.php/hello/"Create Second Application in CodeIgniter FrameworkIf you want to make your own function in CodeIgniter then you can do thatlike this:<?phpclass Hello extends CI_Controller{ public function index() { echo "Hello Vineet !!"; } function test() { echo "Vineet Kumar Saini is MCA Qualified!!"; }}?>This file is to be saved inc:wampwwwCodeIgniterapplicationcontrollershello.php. www.vineetsaini.wordpress.com
  3. 3. OutputOpen the web browser and write the following URL:"http://localhost/CodeIgniter/index.php/hello/test/"Create Application Using Views<?phpclass Hello extends CI_Controller{ public function index() { echo "Hello Vineet !!"; } function test() { $this->load->view (you); //you is the views file }}?>This file is to be saved inc:wampwwwCodeIgniterapplicationcontrollershello.php.Now we will create a view file like this: www.vineetsaini.wordpress.com
  4. 4. <?phpecho "Vineet Kumar Saini is a Software Developer!!";?>This file is to be saved inc:wampwwwCodeIgniterapplicationviewsyou.php.OutputOpen the web browser and write the following URL:"http://localhost/CodeIgniter/index.php/hello/test/"ConclusionSo in this article you saw how to create an application in the CodeIgniterframework in PHP. Using this article one can easily understand creation ofthe application in the CodeIgniter framework in PHP. www.vineetsaini.wordpress.com

×