Enviar pesquisa
Carregar
Who Needs Ruby When You've Got CodeIgniter
•
Transferir como KEY, PDF
•
3 gostaram
•
985 visualizações
C
ciconf
Seguir
Tecnologia
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 82
Baixar agora
Recomendados
Data::FormValidator Simplified
Data::FormValidator Simplified
Fred Moyer
WordPress overloading Gravityforms using hooks, filters and extending classes
WordPress overloading Gravityforms using hooks, filters and extending classes
Paul Bearne
Gravity Forms Hooks & Filters
Gravity Forms Hooks & Filters
iamdangavin
CGI::Prototype (NPW 2006)
CGI::Prototype (NPW 2006)
brian d foy
Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016
Colin O'Dell
Get AngularJS Started!
Get AngularJS Started!
Dzmitry Ivashutsin
Daily notes
Daily notes
meghendra168
Security in laravel
Security in laravel
Sayed Ahmed
Recomendados
Data::FormValidator Simplified
Data::FormValidator Simplified
Fred Moyer
WordPress overloading Gravityforms using hooks, filters and extending classes
WordPress overloading Gravityforms using hooks, filters and extending classes
Paul Bearne
Gravity Forms Hooks & Filters
Gravity Forms Hooks & Filters
iamdangavin
CGI::Prototype (NPW 2006)
CGI::Prototype (NPW 2006)
brian d foy
Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016
Colin O'Dell
Get AngularJS Started!
Get AngularJS Started!
Dzmitry Ivashutsin
Daily notes
Daily notes
meghendra168
Security in laravel
Security in laravel
Sayed Ahmed
Clever Joomla! Templating Tips and Tricks
Clever Joomla! Templating Tips and Tricks
ThemePartner
Сергей Иващенко - Meet Magento Ukraine - Цены в Magento 2
Сергей Иващенко - Meet Magento Ukraine - Цены в Magento 2
Atwix
FamilySearch Reference Client
FamilySearch Reference Client
Dallan Quass
Keeping It Simple
Keeping It Simple
Stephanie Leary
WordPress Theme Design and Development Workshop - Day 3
WordPress Theme Design and Development Workshop - Day 3
Mizanur Rahaman Mizan
Jqeury ajax plugins
Jqeury ajax plugins
Inbal Geffen
Sins Against Drupal 2
Sins Against Drupal 2
Aaron Crosman
Pagination in PHP
Pagination in PHP
Vineet Kumar Saini
Add edit delete in Codeigniter in PHP
Add edit delete in Codeigniter in PHP
Vineet Kumar Saini
Country State City Dropdown in PHP
Country State City Dropdown in PHP
Vineet Kumar Saini
Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB
jhchabran
Drupal sins 2016 10-06
Drupal sins 2016 10-06
Aaron Crosman
Magento Dependency Injection
Magento Dependency Injection
Anton Kril
Amp Up Your Admin
Amp Up Your Admin
Amanda Giles
11. CodeIgniter vederea unei singure inregistrari
11. CodeIgniter vederea unei singure inregistrari
Razvan Raducanu, PhD
Refactoring using Codeception
Refactoring using Codeception
Jeroen van Dijk
WordCamp Denver 2012 - Custom Meta Boxes
WordCamp Denver 2012 - Custom Meta Boxes
Jeremy Green
AngulrJS Overview
AngulrJS Overview
Eyal Vardi
Building secured wordpress themes and plugins
Building secured wordpress themes and plugins
Tikaram Bhandari
JQuery In Rails
JQuery In Rails
Louie Zhao
BAKER DONELSON - Attorney Layoffs The SINKING OF A TERRORIST REGIME (GUJARATI)
BAKER DONELSON - Attorney Layoffs The SINKING OF A TERRORIST REGIME (GUJARATI)
VogelDenise
Yiddish Right of REVOLUTION & Political CORRUPTION
Yiddish Right of REVOLUTION & Political CORRUPTION
VogelDenise
Mais conteúdo relacionado
Mais procurados
Clever Joomla! Templating Tips and Tricks
Clever Joomla! Templating Tips and Tricks
ThemePartner
Сергей Иващенко - Meet Magento Ukraine - Цены в Magento 2
Сергей Иващенко - Meet Magento Ukraine - Цены в Magento 2
Atwix
FamilySearch Reference Client
FamilySearch Reference Client
Dallan Quass
Keeping It Simple
Keeping It Simple
Stephanie Leary
WordPress Theme Design and Development Workshop - Day 3
WordPress Theme Design and Development Workshop - Day 3
Mizanur Rahaman Mizan
Jqeury ajax plugins
Jqeury ajax plugins
Inbal Geffen
Sins Against Drupal 2
Sins Against Drupal 2
Aaron Crosman
Pagination in PHP
Pagination in PHP
Vineet Kumar Saini
Add edit delete in Codeigniter in PHP
Add edit delete in Codeigniter in PHP
Vineet Kumar Saini
Country State City Dropdown in PHP
Country State City Dropdown in PHP
Vineet Kumar Saini
Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB
jhchabran
Drupal sins 2016 10-06
Drupal sins 2016 10-06
Aaron Crosman
Magento Dependency Injection
Magento Dependency Injection
Anton Kril
Amp Up Your Admin
Amp Up Your Admin
Amanda Giles
11. CodeIgniter vederea unei singure inregistrari
11. CodeIgniter vederea unei singure inregistrari
Razvan Raducanu, PhD
Refactoring using Codeception
Refactoring using Codeception
Jeroen van Dijk
WordCamp Denver 2012 - Custom Meta Boxes
WordCamp Denver 2012 - Custom Meta Boxes
Jeremy Green
AngulrJS Overview
AngulrJS Overview
Eyal Vardi
Building secured wordpress themes and plugins
Building secured wordpress themes and plugins
Tikaram Bhandari
JQuery In Rails
JQuery In Rails
Louie Zhao
Mais procurados
(20)
Clever Joomla! Templating Tips and Tricks
Clever Joomla! Templating Tips and Tricks
Сергей Иващенко - Meet Magento Ukraine - Цены в Magento 2
Сергей Иващенко - Meet Magento Ukraine - Цены в Magento 2
FamilySearch Reference Client
FamilySearch Reference Client
Keeping It Simple
Keeping It Simple
WordPress Theme Design and Development Workshop - Day 3
WordPress Theme Design and Development Workshop - Day 3
Jqeury ajax plugins
Jqeury ajax plugins
Sins Against Drupal 2
Sins Against Drupal 2
Pagination in PHP
Pagination in PHP
Add edit delete in Codeigniter in PHP
Add edit delete in Codeigniter in PHP
Country State City Dropdown in PHP
Country State City Dropdown in PHP
Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB
Drupal sins 2016 10-06
Drupal sins 2016 10-06
Magento Dependency Injection
Magento Dependency Injection
Amp Up Your Admin
Amp Up Your Admin
11. CodeIgniter vederea unei singure inregistrari
11. CodeIgniter vederea unei singure inregistrari
Refactoring using Codeception
Refactoring using Codeception
WordCamp Denver 2012 - Custom Meta Boxes
WordCamp Denver 2012 - Custom Meta Boxes
AngulrJS Overview
AngulrJS Overview
Building secured wordpress themes and plugins
Building secured wordpress themes and plugins
JQuery In Rails
JQuery In Rails
Destaque
BAKER DONELSON - Attorney Layoffs The SINKING OF A TERRORIST REGIME (GUJARATI)
BAKER DONELSON - Attorney Layoffs The SINKING OF A TERRORIST REGIME (GUJARATI)
VogelDenise
Yiddish Right of REVOLUTION & Political CORRUPTION
Yiddish Right of REVOLUTION & Political CORRUPTION
VogelDenise
052215 - FAX TO DELNER THOMAS & BENNIE THOMPSON (Turkish)
052215 - FAX TO DELNER THOMAS & BENNIE THOMPSON (Turkish)
VogelDenise
052215 - FAX TO DELNER THOMAS & BENNIE THOMPSON (Tajik)
052215 - FAX TO DELNER THOMAS & BENNIE THOMPSON (Tajik)
VogelDenise
052215 - FAX TO DELNER THOMAS & BENNIE THOMPSON (Yiddish)
052215 - FAX TO DELNER THOMAS & BENNIE THOMPSON (Yiddish)
VogelDenise
020915 PUBLIC RELEASE EEOC CHARGE AGAINST 1ST HERITAGE CREDIT (Malay)
020915 PUBLIC RELEASE EEOC CHARGE AGAINST 1ST HERITAGE CREDIT (Malay)
VogelDenise
Unique Styles of Fishing
Unique Styles of Fishing
Paul Katsus
GEORGE ZIMMERMAN & EBOLA CRISIS (Urdu)
GEORGE ZIMMERMAN & EBOLA CRISIS (Urdu)
VogelDenise
03/30/15 FAX EMAIL TO BENNIE THOMPSON-Corrected
03/30/15 FAX EMAIL TO BENNIE THOMPSON-Corrected
VogelDenise
Programes de formació i inserciò (pfi)
Programes de formació i inserciò (pfi)
Ferran Piñataro
A study to compare trajectory generation algorithms for automatic bucket fill...
A study to compare trajectory generation algorithms for automatic bucket fill...
Reno Filla
An Event-driven Operator Model for Dynamic Simulation of Construction Machinery
An Event-driven Operator Model for Dynamic Simulation of Construction Machinery
Reno Filla
021013 adecco email (welsh)
021013 adecco email (welsh)
VogelDenise
BAKER DONELSON - Attorney Layoffs The SINKING OF A TERRORIST REGIME (CORSICAN)
BAKER DONELSON - Attorney Layoffs The SINKING OF A TERRORIST REGIME (CORSICAN)
VogelDenise
061612 Slideshare Analytic Report Through 06/16/12
061612 Slideshare Analytic Report Through 06/16/12
VogelDenise
CIPR PRide Awards - Home Counties South
CIPR PRide Awards - Home Counties South
Precise Brand Insight
Hatian Creole Right of REVOLUTION & Political CORRUPTION
Hatian Creole Right of REVOLUTION & Political CORRUPTION
VogelDenise
062112 esperanto (supreme court)
062112 esperanto (supreme court)
VogelDenise
Persian Right of REVOLUTION & Political CORRUPTION
Persian Right of REVOLUTION & Political CORRUPTION
VogelDenise
Essay Parts
Essay Parts
DrShokry Almenshawy
Destaque
(20)
BAKER DONELSON - Attorney Layoffs The SINKING OF A TERRORIST REGIME (GUJARATI)
BAKER DONELSON - Attorney Layoffs The SINKING OF A TERRORIST REGIME (GUJARATI)
Yiddish Right of REVOLUTION & Political CORRUPTION
Yiddish Right of REVOLUTION & Political CORRUPTION
052215 - FAX TO DELNER THOMAS & BENNIE THOMPSON (Turkish)
052215 - FAX TO DELNER THOMAS & BENNIE THOMPSON (Turkish)
052215 - FAX TO DELNER THOMAS & BENNIE THOMPSON (Tajik)
052215 - FAX TO DELNER THOMAS & BENNIE THOMPSON (Tajik)
052215 - FAX TO DELNER THOMAS & BENNIE THOMPSON (Yiddish)
052215 - FAX TO DELNER THOMAS & BENNIE THOMPSON (Yiddish)
020915 PUBLIC RELEASE EEOC CHARGE AGAINST 1ST HERITAGE CREDIT (Malay)
020915 PUBLIC RELEASE EEOC CHARGE AGAINST 1ST HERITAGE CREDIT (Malay)
Unique Styles of Fishing
Unique Styles of Fishing
GEORGE ZIMMERMAN & EBOLA CRISIS (Urdu)
GEORGE ZIMMERMAN & EBOLA CRISIS (Urdu)
03/30/15 FAX EMAIL TO BENNIE THOMPSON-Corrected
03/30/15 FAX EMAIL TO BENNIE THOMPSON-Corrected
Programes de formació i inserciò (pfi)
Programes de formació i inserciò (pfi)
A study to compare trajectory generation algorithms for automatic bucket fill...
A study to compare trajectory generation algorithms for automatic bucket fill...
An Event-driven Operator Model for Dynamic Simulation of Construction Machinery
An Event-driven Operator Model for Dynamic Simulation of Construction Machinery
021013 adecco email (welsh)
021013 adecco email (welsh)
BAKER DONELSON - Attorney Layoffs The SINKING OF A TERRORIST REGIME (CORSICAN)
BAKER DONELSON - Attorney Layoffs The SINKING OF A TERRORIST REGIME (CORSICAN)
061612 Slideshare Analytic Report Through 06/16/12
061612 Slideshare Analytic Report Through 06/16/12
CIPR PRide Awards - Home Counties South
CIPR PRide Awards - Home Counties South
Hatian Creole Right of REVOLUTION & Political CORRUPTION
Hatian Creole Right of REVOLUTION & Political CORRUPTION
062112 esperanto (supreme court)
062112 esperanto (supreme court)
Persian Right of REVOLUTION & Political CORRUPTION
Persian Right of REVOLUTION & Political CORRUPTION
Essay Parts
Essay Parts
Semelhante a Who Needs Ruby When You've Got CodeIgniter
Dealing with Legacy PHP Applications
Dealing with Legacy PHP Applications
Clinton Dreisbach
Dealing With Legacy PHP Applications
Dealing With Legacy PHP Applications
Viget Labs
前后端mvc经验 - webrebuild 2011 session
前后端mvc经验 - webrebuild 2011 session
RANK LIU
Smarty
Smarty
Aravind Vel
Bag Of Tricks From Iusethis
Bag Of Tricks From Iusethis
Marcus Ramberg
Developing for Business
Developing for Business
Antonio Spinelli
Os Nixon
Os Nixon
oscon2007
Practical PHP by example Jan Leth-Kjaer
Practical PHP by example Jan Leth-Kjaer
COMMON Europe
TDC2016SP - Trilha Developing for Business
TDC2016SP - Trilha Developing for Business
tdc-globalcode
You're Doing it Wrong - WordCamp Orlando
You're Doing it Wrong - WordCamp Orlando
Chris Scott
Shangz R Brown Presentation
Shangz R Brown Presentation
shangbaby
Zero to SOLID
Zero to SOLID
Vic Metcalfe
How to Create Login and Registration API in PHP.pdf
How to Create Login and Registration API in PHP.pdf
Appweb Coders
Unit testing zend framework apps
Unit testing zend framework apps
Michelangelo van Dam
Tidy Up Your Code
Tidy Up Your Code
Abbas Ali
Login and Registration form using oop in php
Login and Registration form using oop in php
herat university
Improving state of M2 front-end - Magento 2 Community Project
Improving state of M2 front-end - Magento 2 Community Project
Bartek Igielski
Building scalable products with WordPress - WordCamp London 2018
Building scalable products with WordPress - WordCamp London 2018
Elliot Taylor
PHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4Developers
Kacper Gunia
Framework
Framework
Nguyen Linh
Semelhante a Who Needs Ruby When You've Got CodeIgniter
(20)
Dealing with Legacy PHP Applications
Dealing with Legacy PHP Applications
Dealing With Legacy PHP Applications
Dealing With Legacy PHP Applications
前后端mvc经验 - webrebuild 2011 session
前后端mvc经验 - webrebuild 2011 session
Smarty
Smarty
Bag Of Tricks From Iusethis
Bag Of Tricks From Iusethis
Developing for Business
Developing for Business
Os Nixon
Os Nixon
Practical PHP by example Jan Leth-Kjaer
Practical PHP by example Jan Leth-Kjaer
TDC2016SP - Trilha Developing for Business
TDC2016SP - Trilha Developing for Business
You're Doing it Wrong - WordCamp Orlando
You're Doing it Wrong - WordCamp Orlando
Shangz R Brown Presentation
Shangz R Brown Presentation
Zero to SOLID
Zero to SOLID
How to Create Login and Registration API in PHP.pdf
How to Create Login and Registration API in PHP.pdf
Unit testing zend framework apps
Unit testing zend framework apps
Tidy Up Your Code
Tidy Up Your Code
Login and Registration form using oop in php
Login and Registration form using oop in php
Improving state of M2 front-end - Magento 2 Community Project
Improving state of M2 front-end - Magento 2 Community Project
Building scalable products with WordPress - WordCamp London 2018
Building scalable products with WordPress - WordCamp London 2018
PHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4Developers
Framework
Framework
Mais de ciconf
CICONF 2012 - Don't Make Me Read Your Mind
CICONF 2012 - Don't Make Me Read Your Mind
ciconf
Chef + AWS + CodeIgniter
Chef + AWS + CodeIgniter
ciconf
Work Queues
Work Queues
ciconf
Pretty Good Practices/Productivity
Pretty Good Practices/Productivity
ciconf
Hosting as a Framework
Hosting as a Framework
ciconf
Zero to Hero in Start-ups
Zero to Hero in Start-ups
ciconf
How to use ORM
How to use ORM
ciconf
Mais de ciconf
(7)
CICONF 2012 - Don't Make Me Read Your Mind
CICONF 2012 - Don't Make Me Read Your Mind
Chef + AWS + CodeIgniter
Chef + AWS + CodeIgniter
Work Queues
Work Queues
Pretty Good Practices/Productivity
Pretty Good Practices/Productivity
Hosting as a Framework
Hosting as a Framework
Zero to Hero in Start-ups
Zero to Hero in Start-ups
How to use ORM
How to use ORM
Último
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Enterprise Knowledge
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Principled Technologies
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
HampshireHUG
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
hans926745
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
debabhi2
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
naman860154
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
Allon Mureinik
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
Results
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Roshan Dwivedi
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Maria Levchenko
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Rafal Los
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Radu Cotescu
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Martijn de Jong
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Michael W. Hawkins
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Safe Software
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Delhi Call girls
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
wesley chun
Slack Application Development 101 Slides
Slack Application Development 101 Slides
praypatel2
Último
(20)
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
Slack Application Development 101 Slides
Slack Application Development 101 Slides
Who Needs Ruby When You've Got CodeIgniter
1.
WHO NEEDS RUBY
WHEN YOU’VE GOT CODEIGNITER? Jamie Rumbelow @jamierumbelow CodeIgniter Conference, London, 2012
2.
HI, I’M JAMIE
3.
PLUG:
4.
5.
codeigniterhandbook.com
6.
7.
SORRY CODEIGNITER, I’VE GOT
ANOTHER GIRL
8.
BUT I STILL
♥ YOU
9.
CODEIGNITER IS MY
WIFE, RAILS IS MY MISTRESS
10.
RAILS DEVELOPERS?
11.
SMUG.
12.
IN REALITY, RAILS DEVS
ARE RINGOS
13.
“Totally the hot
shit”
14.
BOLLOCKS!
15.
RUBY
16.
NOPE!
17.
IT’S ALL ABOUT THE
CONCEPTS
18.
FLEXIBILITY
19.
20.
OTHER FRAMEWORKS
COPY
21.
CODEIGNITER ADAPTS
22.
WHAT CONCEPTS?
23.
CONVENTION
> CONFIGURATION
24.
DON’T REPEAT YOURSELF
25.
A DAY IN
THE LIFE
26.
MVC
27.
MVC
28.
IT’S ALL ABOUT
THE DATA
29.
IT’S ALL ABOUT *PROCESSING
THE DATA
30.
FAT MODEL SKINNY CONTROLLER
31.
MY_Model
32.
public function get($where) {
return $this->db->where($where) ->get($this->_table); }
33.
PLURAL TABLE NAME
34.
$this->_table = strtolower(plural(str_replace('_model',
'', get_class())));
35.
class User_model extends
MY_Model { } Text class Post_model extends MY_Model { } class Category_model extends MY_Model { }
36.
OBSERVERS
37.
class User_model extends
MY_Model { public $before_create = array( 'hash_password' ); }
38.
foreach ($this->before_create as
$method) { $data = call_user_func_array(array($this, $method), array($data)); }
39.
public function hash_password($user) {
$user['password'] = sha1($user['password']); return $user; }
40.
SCOPES
41.
return $this;
42.
public function confirmed() {
$this->db->where('confirmed', TRUE); return $this; }
43.
$this->user->confirmed()->get_all();
44.
VALIDATION
45.
YOU’RE DOING IT WRONG
46.
class User_model extends
MY_Model { public $validate = array( array( 'field' => 'username', 'label' => 'Username', 'rules' => 'required|max_length[20]|alpha_dash' ), array( 'field' => 'password', 'label' => 'Password', 'rules' => 'required|min_length[8]' ), array( 'field' => 'email', 'label' => 'Email', 'rules' => 'valid_email' ) ); }
47.
foreach ($data as
$key => $value) { $_POST[$key] = $value; }
48.
$this->form_validation->set_rules($this->validate); return $this->form_validation->run();
49.
MVC
50.
PRESENTERS
51.
<div id="account">
<h1> <?= $this->bank->get($account->bank_id)->name ?> - <?= $account->title ?> </h1> <p class="information"> <strong>Name:</strong> <?php if ($account->name): ?><?= $account->name ?><?php else: ?>N/ A<?php endif; ?><br /> <strong>Number:</strong> <?php if ($account->number): ?><?= $account->number ?><?php else: ?>N/A<?php endif; ?><br /> <strong>Sort Code:</strong> <?php if ($account->sort_code): ?><?= substr($account->sort_code, 0, 2) . "-" . substr($account->sort_code, 2, 2) . "-" . substr($account->sort_code, 4, 2) ?><?php else: ?>N/ A<?php endif; ?> </p> <p class="balances"> <strong>Total Balance:</strong> <?php if ($account->total_balance): ?><?= "£" . number_format($account->total_balance) ?><?php else: ?>N/A<?php endif; ?> <strong>Available Balance:</strong> <?php if ($account->available_balance): ?><?= "£" . number_format($account->available_balance) ?><?php else: ?>N/A<?php endif; ?> </p> <p class="statements"> <?php if ($this->statements->count_by('account_id', $account->id)): ?> <?= anchor('/statements/' . $account->id, 'View Statements') ?> <?php else: ?> Statements Not Currently Available <?php endif; ?> </p> </div>
52.
<div id="account">
<h1> <?= $account->title() ?> </h1> <p class="information"> <strong>Name:</strong> <?= $account->name() ?><br /> <strong>Number:</strong> <?= $account->number() ?><br /> <strong>Sort Code:</strong> <?= $account->sort_code() ?> </p> <p class="balances"> <strong>Total Balance:</strong> <?= $account->total_balance() ?> <strong>Available Balance:</strong> <?= $account->available_balance() ?> </p> <p class="statements"> <?= $account->statements_link() ?> </p> </div>
53.
ENCAPSULATE THE CLASS
54.
class Account_presenter {
public function __construct($account) { $this->account = $account; } }
55.
public function title() {
return get_instance()->bank->get($this->account->bank_id)->name . "-" . $this->account->title; }
56.
GETTING BETTER
57.
public function number() {
return $this->account->number ?: "N/A"; }
58.
<div id="account">
<h1> <?= $this->bank->get($account->bank_id)->name ?> - <?= $account->title ?> </h1> <p class="information"> <strong>Name:</strong> <?php if ($account->name): ?><?= $account->name ?><?php else: ?>N/ A<?php endif; ?><br /> <strong>Number:</strong> <?php if ($account->number): ?><?= $account->number ?><?php else: ?>N/A<?php endif; ?><br /> <strong>Sort Code:</strong> <?php if ($account->sort_code): ?><?= substr($account->sort_code, 0, 2) . "-" . substr($account->sort_code, 2, 2) . "-" . substr($account->sort_code, 4, 2) ?><?php else: ?>N/ A<?php endif; ?> </p> <p class="balances"> <strong>Total Balance:</strong> <?php if ($account->total_balance): ?><?= "£" . number_format($account->total_balance) ?><?php else: ?>N/A<?php endif; ?> <strong>Available Balance:</strong> <?php if ($account->available_balance): ?><?= "£" . number_format($account->available_balance) ?><?php else: ?>N/A<?php endif; ?> </p> <p class="statements"> <?php if ($this->statements->count_by('account_id', $account->id)): ?> <?= anchor('/statements/' . $account->id, 'View Statements') ?> <?php else: ?> Statements Not Currently Available <?php endif; ?> </p> </div>
59.
<div id="account">
<h1> <?= $account->title() ?> </h1> <p class="information"> <strong>Name:</strong> <?= $account->name() ?><br /> <strong>Number:</strong> <?= $account->number() ?><br /> <strong>Sort Code:</strong> <?= $account->sort_code() ?> </p> <p class="balances"> <strong>Total Balance:</strong> <?= $account->total_balance() ?> <strong>Available Balance:</strong> <?= $account->available_balance() ?> </p> <p class="statements"> <?= $account->statements_link() ?> </p> </div>
60.
MVC
61.
AUTOLOADING
62.
application/views/controller/action.php
63.
application/views/controller/action.php
64.
application/views/controller/action.php
65.
application/views/posts/action.php
66.
application/views/posts/index.php
67.
Posts::index(); application/views/posts/index.php
68.
Posts::create(); application/views/posts/create.php
69.
Comments::submit_spam(); application/views/comments/submit_spam.php
70.
MY_Controller
71.
_remap()
72.
$view = strtolower(get_class($this))
. '/' . $method;
73.
$view = strtolower(get_class($this))
. '/' . $method;
74.
$view = strtolower(get_class($this))
. '/' . $method;
75.
$this->load->view($view, $this->data);
76.
public function index() {
$this->data['users'] = $this->user->get_all(); $this->data['title'] = 'All Users'; }
77.
HELP!
78.
$this->load->view('shared/_header', $data);
$this->load->view('users/all', $data); $this->load->view('shared/_footer', $data);
79.
$this->data['yield'] = $this->load->view($view,
$this->data, TRUE); $this->load->view('layouts/application', $this->data);
80.
<header> <h1>My
Application</h1> </header> <div id="wrapper"> <?= $yield ?> </div> <footer> <p>Copyright © 2012</p> </footer>
81.
THE END
82.
Jamie Rumbelow
@jamierumbelow jamieonsoftware.com The CodeIgniter Handbook codeigniterhandbook.com
Notas do Editor
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
Baixar agora