2. Open Source PHP Framework
<?php
$this->load->view(‘about’);
3. Open Source PHP Framework
Free (as in beer / as in rights)
<?php
$this->load->view(‘about’);
4. Open Source PHP Framework
Free (as in beer / as in rights)
The “guts” of ExpressionEngine 2
<?php
$this->load->view(‘about’);
5. Open Source PHP Framework
Free (as in beer / as in rights)
The “guts” of ExpressionEngine 2
Backed by bootstrapped company
<?php
$this->load->view(‘about’);
Free to downloadCan virtually do anything with framework- Can not create a commercial blogging application
EE2 is built on top of the CodeIgniter framework
EllisLab supports the company and it’s 11 employees off of ExpressionEngine primarily.CodeIgniter is the foundation of the new version of ExpressionEngine.EllisLab is committed to supporting the framework, it’s not a side project it is the core of their business.
In 2001, Rick Ellis started work on a blogging engine for his clients.The first installation of pMachine was for Nancy Sinatra (Frank Sinatra’s daughter).
In 2002, pMachine was released.Featured in Mac World and Mac Addict as well as a Blogging book published by McGraw/Hill.Rick Ellis starts developing software full-time.
ExpressionEngine succeeds pMachine and is a more fully feature complete Content Management System.ExpressionEngine sees great success within the designer market, on their personal blogs (VeerlePieters, for instance).
EllisLab pulls the core code out of ExpressionEngine and refactors into a framework.
At SXSW ’08, EllisLab announces ExpressionEngine 2.Derek Allard, Code Architect for EllisLab, announces that ExpressionEngine 2 will run on top of the CodeIgniter framework.Full Circle: CodeIgniter was born from ExpressionEngine and now it is powering ExpressionEngine
Benchmarking performed by AvnetLabs w/ eAcceleratoropcode caching10.5x faster than CakePHP, 2.9x faster than Zend Framework (similar configurations / similar functionality)I’ve never seen a benchmark where CodeIgniter didn’t outperform all competitors
Statistics dated Oct 08, from nexen.netShows about a 50/50 split between PHP4 and 5 support.No doubt PHP5 has taken the lead by now, but many users still stuck on PHP4.CodeIgniter utilizes PHP5 features/performance-enhancing functionality when present.
MySQL is by far the most supported but could switch without the need to completely rewrite code.Supports MySQL, MS SQL, Oracle, PostgreSQL, SQLite and ODBC connectors.ActiveRecord class allows you to think in PHP and generate SQL.
Facebook, MySpace,Twitter and other social networks have seen the rise of a new form of worm.These worms are Javascript based, essentially the attacker enters code into a form that your site displays somewhere.This allows the malicious code to run from your domain essentially bypassing all of the domain-lock features Javascript has built-in.At the flick of a boolean variable, CodeIgniter will automatically protect all of your form fields from XSS vulnerabilities.
CodeIgniter automatically generates SEO friendly URLsOf course, this is easily overidden: regular expression pattern matching to point to controller/method and pass variables
Nearly every CodeIgniter library and helper can be overridden – allowing you to increase functionality.Examples: auto-discovery of partial views, auto-discovery of models, authentication by basing application classes off of my own controller class, which in turns extends the CodeIgniter Controller class
RasmusLerdorf at fOScon 08.He gave a presentation pretty much slamming all PHP frameworks. If he had to pick one, it would be CodeIgniter.
The model represents our data – in this particular case we are returning data from a database.Could return data from anything – a Web API, an XML file, JSON, etc.
All models extends CodeIgniter’s Model class and must call the parent class’ constructor from their own constructor.
This function starts building our SQL query by creating the ORDER BY portion.get() will run the query against the posts table, returning 10 results starting at row 0.We also have a get_where() method, that allows you to pass WHERE statements.get() will return all columns, but a select() method is available to define columns if necessary.We use the num_rows() method to return a result object or the FALSE boolean.
The controller accepts and handles all user input (URLs, POST/GET requests, etc.)Like the model, a controller extends the CI Controller class.Controllers must call their parent constructor from within their own constructor.index() method is called by default, if a method is not defined in the URL.We load our post model, then call the get_all() method of that model.We then load a view, called home, and pass it our array of variables (in this case, only the posts).
Like the model, a controller extends the CI Controller class.Controllers must call their parent constructor from within their own constructor.
index() method is called by default, if a method is not defined in the URL.We load our post model, then call the get_all() method of that model.We then load a view, called home, and pass it our array of variables (in this case, only the posts).
The view is simply an HTML file with PHP inter-mixed.Logic should be kept to a bare minimum – just echo data in the view.Templating engines can be used and CI even has a Template Parsing class (why would you want to add more processing time)?Notice the lack of the $data variable – within a view, CodeIgniter brings all $data keys (or child objects) up to top-level variables.Normally, we would check for a FALSE value before looping and show a “No Posts” message – lack of space on screen here.
Loop through each of the results returned from our database call (which happened in the model).
Echo out the title of the post, title was one of the fields within our posts table.
Echo out the excerpt of the post, once again a field within our table.
Use a CodeIgniter helper to generate a link to read the entire post.First parameter is the URI segments, second is text of the link, third is an optional array of HTML attributes.Slug was a field within our database – CodeIgniter has a helper to autocreate slugs from text.Would use URI routing to process this request and send it to Controller/Method