Hybridoma Technology ( Production , Purification , and Application )
Codeigniter
1.
2. 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
6. 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
7. 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.
9. 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
10. 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.
11. 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
12. 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
13. 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 />
14. Models
• Models are PHP classes that are designed to
work with information in a database
– $this->load->model('Model_name');
15. 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);
}
}
18. 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
19. 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