PHP Frameworks & Introduction to CodeIgniter

13
PHP Frameworks & Introduction to CodeIgniter Jamshid Hashimi Trainer, Cresco Solution http://www.jamshidhashimi.com [email protected] @jamshidhashimi ajamshidhashimi Afghanistan Workforce Development Program

Transcript of PHP Frameworks & Introduction to CodeIgniter

Page 1: PHP Frameworks & Introduction to CodeIgniter

PHP Frameworks & Introduction to CodeIgniter

Jamshid HashimiTrainer, Cresco Solution

http://www.jamshidhashimi.com [email protected] @jamshidhashimi ajamshidhashimi

Afghanistan Workforce Development Program

Page 2: PHP Frameworks & Introduction to CodeIgniter

Agenda

• What is a Framework?• Libraries vs. Frameworks• Advantage of using Framework• Introduction to CodeIgniter• Why CodeIgniter? • Analyzing Different Frameworks

Page 3: PHP Frameworks & Introduction to CodeIgniter

What is a Framework?

• Frameworks are of key importance for developing large-scale object-oriented software systems. They promise higher productivity and shorter time-to-market through design and code reuse.

• Software frameworks include support programs, compilers, code libraries, tool sets, and application programming interfaces (APIs) that bring together all the different components to enable development of a project or solution.

Page 4: PHP Frameworks & Introduction to CodeIgniter

Libraries vs. Frameworks

• Inversion of control – In a framework, unlike in libraries or normal user applications, the overall program's flow of control is not dictated by the caller, but by the framework.

• Default behavior – A framework has a default behavior. • Extensibility – A framework can be extended by the user

usually by selective overriding or specialized by user code to provide specific functionality.

• Non-modifiable framework code – The framework code, in general, is not allowed to be modified, excepting extensibility. Users can extend the framework, but not modify its code.

Page 5: PHP Frameworks & Introduction to CodeIgniter

Advantage of using Framework• Efficiency

– Pre-built functions - Hours and hundreds of lines of code to write– Easier, faster, and consequently efficient.

• Security– Big security implementations.– Community

• Cost– Free– Code Faster

• Support– Documentation– Community Forums– Stackoverflow!

Page 6: PHP Frameworks & Introduction to CodeIgniter

Introduction to CodeIgniter

• CodeIgniter is a toolkit for people who build web applications using PHP. Its goal is to enable you to develop projects much faster than you could if you were writing code from scratch, by providing a rich set of libraries for commonly needed tasks, as well as a simple interface and logical structure to access these libraries. CodeIgniter lets you creatively focus on your project by minimizing the amount of code needed for a given task.

Page 7: PHP Frameworks & Introduction to CodeIgniter

Why CodeIgniter?

• CodeIgniter is Free• CodeIgniter is Light Weight• CodeIgniter is Fast– Really fast. We challenge you to find a framework that

has better performance than CodeIgniter.• CodeIgniter Uses M-V-C– CodeIgniter uses the Model-View-Controller approach

• CodeIgniter is Thoroughly Documented• CodeIgniter has a Friendly Community of Users

Page 8: PHP Frameworks & Introduction to CodeIgniter

Introduction to CodeIgniter

• CodeIgniter Generates Clean URLs– The URLs generated by CodeIgniter are clean and search-engine

friendly. CodeIgniter uses a segment-based approach.– example.com/news/article/345

• CodeIgniter Packs a Punch– CodeIgniter comes with full-range of libraries that enable the most

commonly needed web development tasks, like accessing a database, sending email, validating form data, maintaining sessions, manipulating images, working with XML-RPC data and much more.

• CodeIgniter is Extensible– Your own libraries, helpers, or through class extensions or system

hooks.

Page 9: PHP Frameworks & Introduction to CodeIgniter

Introduction to CodeIgniter

• CodeIgniter Does Not Require a Template Engine

<ul><?php foreach ($addressbook as $name):?><li><?=$name?></li><?php endforeach; ?></ul>

<ul>{foreach from=$addressbook item="name”}<li>{$name}</li>{/foreach}</ul>

Page 10: PHP Frameworks & Introduction to CodeIgniter

Analyzing Different Frameworks

• CakePHP• Kohana• Zend• Yii• Symphony• Laravel• CodeIgniter!

Page 11: PHP Frameworks & Introduction to CodeIgniter

SETUP & CONFIGURATION

Page 12: PHP Frameworks & Introduction to CodeIgniter

DEMO

Page 13: PHP Frameworks & Introduction to CodeIgniter

QUESTIONS?