Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ian J Robotham Software Development Lead Medi-CAL Unit, University of Aberdeen.

Similar presentations


Presentation on theme: "Ian J Robotham Software Development Lead Medi-CAL Unit, University of Aberdeen."— Presentation transcript:

1 Ian J Robotham Software Development Lead Medi-CAL Unit, University of Aberdeen

2 Who? Ellis Labs Inc. Based in Bend, Oregon

3 What? Open source Web Application Framework Lightweight Available for 5 years

4 Why? Rapid Application Development Noted for Speed Handles much of the mundane – query processing, pagination, validation etc.

5 MVC Controller Model View

6 Getting Started http://codeigniter.com/downloads/ Download, extract & rename = “working” app Configure & Code

7 Security URL Anti register_globals XSS Filtering CSRF Automatic GET/POST/COOKIE cleaning Database escaping

8 Active Record Modified version of design pattern Database independence* Allows chaining (PHP5+) $query = $this->db->from(‘users’) ->where(‘dept’, ‘DIT’) ->order_by(‘lastname asc’); foreach ($query->result() as $row) { echo $row->firstname.’ ‘.$row->lastname; }

9 Form Validation In controller Some exists but can write own tests $this->load->library('form_validation'); $this->form_validation->set_rules('username', 'Username', 'required'); $this->form_validation->set_rules('password', 'Password', 'required'); $this->form_validation->set_rules('passconf', 'Password Confirmation', 'required'); $this->form_validation->set_rules('email', 'Email', 'required|valid_email'); if ($this->form_validation->run() == FALSE) { $this->load->view('myform'); } else { $this->load->view('formsuccess'); }

10 Libraries Classes to add functionality Write own (or use other external) Extend native CI libraries Replace native CI libraries E.g. use to add TCPDF for PDF generation or ExcelWriter etc. Can call elements of CI core

11 Helpers Collection of functions Not OO Independent Can use in views, controller Can call CI core if needed

12 Inheritance Useful in Controllers & Models Create UOA_Model which each model extends – Handle simple CRUD calls Create UOA_Controller which each controller extends – Handle common functions e.g. security checks etc.

13 Sparks Fairly new http://getsparks.org/ Repository of CI libraries (kind of) API integrations e.g. Flickr, Google, Twitter Payment integrations Authentication & more Don’t reinvent the wheel

14 Other Options Zend Framework CakePHP Symfony Yii http://www.phpframeworks.com/ http://www.phpframeworks.com/top-10-php- frameworks/

15 Questions? i.robotham@abdn.ac.uk 01224 437036 (UOA 7036) @eyejaynet


Download ppt "Ian J Robotham Software Development Lead Medi-CAL Unit, University of Aberdeen."

Similar presentations


Ads by Google