Codeinator
-
Upload
muhammed-thanveer-danish-melayi -
Category
Software
-
view
108 -
download
1
Transcript of Codeinator
Disclaimer: This presentation is prepared by trainees ofbaabtra.com as a part of mentoring program. This is notofficial document of baabtra.com – Mentoring Partner
What is CodeIgninter
• CodeIgniter is an Application Development Framework - a toolkit - for people who build web sites using PHP.
• CodeIgniter is open source.
• Was built by EllisLab.
• The first public version of CodeIgniter was released on February 28, 2006.
Features
• Runs on PHP 4
• Light Weight
• Fast
• Uses M-V-C
• Clean URLs
• Packs a Punch
• Extensible
• Friendly Community of Users
• Thoroughly Documented
Advantage of Co….
• Helpers and libraries.
• Support PHP 4 or PHP.
• Exceptional performance.
• Lightweight.
• Very fast.
• Clear document
Overview CI framworkController(The Controller is the C in MVC. The base controller is a simple abstract class that defines the structure of all controllers.)
• <?php
• class First extends Controller{
• function First() {
• parent::Controller();
• }
• function index() {
• echo “<h1> Hello CUET !! </h1> “;
• }
• }
• ?>
• // Output Will be “Hello CUET!!”
View
• A Webpage or A page Fragment
• Should be placed under “application/views”
• Never Called Directly
• web_root/myci/system/application/views/myview.php
Calling a veiw from controller
• $this->load->view(‘myview’);
• Data passing from controller • function index() {
• $var = array(
• ‘full_name’ => ‘Amzad Hossain’,
• ‘email’ => ‘[email protected]’
• );
• $this->load->view(‘myview’, $var);
• }
• …………………………………………………………………………………………………………………………….• <html>
• <title> ..::Personal Info::.. </title>
• <body>
• Full Name : <?php echo $full_name;?> <br />
• E-mail : <?=email;?> <br />
• </body>
• </html>
Models
Designed to work with Information of Database
Models Should be placed Under “application/models/”
example
• <?php
• class Mymodel extend Model{
• function Mymodel() {
• parent::Model();
• }
• function get_info() {
• $query = $this->db->get(‘name’, 10);
• /*Using ActiveRecord*/
• return $query->result();
• }
• }
• ?>
Loading a Model inside a Controller
$this->load->model(‘mymodel’);
$data = $this->mymodel->get_info();
Loading co… library
• $this->load->library(‘database’);
Database LibraryAbstract Database Class support traditional structures and Active Record Pattern.• function index() {
• $this->load->library(‘database’);
• $rslt = $this->db->query(“select first_name from
user_name”);
• foreach( $rslt->result() as $row_data)
• echo $row_data->first_name . “<br />”;
• }
Loading A Helper Inside a Controller
• $this->load->helper(‘helper_name’);
• $this->load->helper(array(‘form’,’url’) );
Helpers
Form Helper form_open()
form_open_multipart()
form_input()
form_textarea()
form_checkbox()
form_submit()
form_close()
URL Helper site_url()
base_url()
anchor()
anchor_popup()
mailto()
Want to learn more about programming or Looking to become a good programmer?
Are you wasting time on searching so many contents online?
Do you want to learn things quickly?
Tired of spending huge amount of money to become a Software professional?
Do an online course @ baabtra.com
We put industry standards to practice. Our structured, activity based courses are so designedto make a quick, good software professional out of anybody who holds a passion for coding.
Follow us @ twitter.com/baabtra
Like us @ facebook.com/baabtra
Subscribe to us @ youtube.com/baabtra
Become a follower @ slideshare.net/BaabtraMentoringPartner
Connect to us @ in.linkedin.com/in/baabtra
Give a feedback @ massbaab.com/baabtra
Thanks in advance
www.baabtra.com | www.massbaab.com |www.baabte.com
Emarald Mall (Big Bazar Building)Mavoor Road, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550
NC Complex, Near Bus StandMukkam, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550
Cafit Square,Hilite Business Park,Near Pantheerankavu,Kozhikode
Start up VillageEranakulam,Kerala, India.
Email: [email protected]
Contact Us