Codeigniter

822 views

Published on

Codeigniter

Published in: Education, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
822
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
15
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Codeigniter

  1. 1. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  2. 2. Typing Speed Week Target Achieved 1 35 27 2 35 29 3
  3. 3. Jobs Applied # Company Designation Applied Date 1 Creative solutions PHP Developer 17-sep-2013 2 Sun softwares PHP Developer 17-sep-2013 3 Current Status
  4. 4. CodeIgniter Sarbazali.N. sarbazalin@gmail.com. www.facebook.com/sarbazali.sarbaz. twitter.com/sarbaz_ali. in.linkedin.com/in/sarbazali. +919037896770.
  5. 5. What is Codeigniter? • CI is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create fullfeatured web applications
  6. 6. About CodeIgniter ● CodeIgniter is a lightweight web application framework written in PHP that adopts the modelview-controller approach to development ● Open source ● Well-supported by an active community ● Excellent “by example” documentation ● Easy to configure ● Supports multiple database ● Was built by EllisLab.
  7. 7. THE STRUCTURES OF CI WEBSITE
  8. 8. Controllers Controller is simply a class file that is named in a way that can be associated with a URI – localhost/index.php/hello/  Function ◦ function can be add to the controller and called by the URI segment  localhost/index.php/hello/index
  9. 9. Controllers In This Particular Code www.your-site.com/index.php/first/bdosdn/world <?php class First extends Controller{ function index() { echo “<h1> Hello CUET !! </h1> “; } function bdosdn( $location ) { echo “<h2> Hello $location !! </h2>”; } } ?> // Output Will be “Hello world !!” • Note: • The ‘Index’ Function always loads by default. Unless there is a second segment in the URL •Class names must start with an Uppercase Letter.
  10. 10. VIEWS • View is simply a web page, or a page fragment, like a header, footer, sidebar, etc. – views can flexibly be embedded within other views (within other views, etc., etc.) – views are never called directly, they must be loaded by a controller • Loading a View – $this->load->view('name'); • name is the name of your view file
  11. 11. VIEWS  A Webpage or A page Fragment  Should be placed under “application/views”  Never Called Directly web_root/myci/system/application/views/myview.php <html> <title> My First CodeIgniter Project</title> <body> <h1> Welcome ALL … To My .. ::: First Project ::: . . . </h1> </body> </html> 12
  12. 12. VIEWS Calling a VIEW from Controller $this->load->view(‘myview’); Data Passing to a VIEW from Controller function index() { $var = array( ‘full_name’ => ‘Amzad Hossain’, ‘email’ => ‘tohi1000@yahoo.com’ ); $this->load->view(‘myview’, $var); } <html> <title> ..::Personal Info::.. </title> <body> Full Name : <?php echo $full_name;?> E-mail : <?php echo $email;?> <br /> </body> </html> <br />
  13. 13. Models • Models are PHP classes that are designed to work with information in a database – $this->load->model('Model_name');
  14. 14. Models Designed to work with Information of Database Models Should be placed Under “application/models/” class Log extends CI_Model { public function sample($data) { $this->load->database(); $q=$this->db->query("SELECT * from tbl_user where username='$data[username]' and password='$data[password]'"); $res = $q->result(); if (!empty($res)) { foreach ($q->result() as $row) { return $data=array('username'=>$row->username,'password'=>$row->password); } }
  15. 15. Advantages of CodeIgniter • • • • • • Helpers and libraries. Support PHP 4 or PHP. Exceptional performance. Lightweight. Very fast. Clear document.
  16. 16. THANK YOU
  17. 17. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  18. 18. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550

×