SlideShare une entreprise Scribd logo
1  sur  65
Télécharger pour lire hors ligne
快速上手 CodeIgniter
  吳柏毅 Bo-Yi Wu
    appleboy
 http://blog.wu-boy.com/
        2011.11.12
 2011 PHP Conference
內容皆採用 創用 CC 姓名標示
相同方式分享 3.0 台灣 授權條款
$this->load->view('about/me')

    瑞昱半導體股份有限公司
            Linux Kernel Driver, Sencha Touch Web App.
    CodeIgniter 台灣站長 http://codeigniter.org.tw
            翻譯線上文件
            提交 Patch 給官方 CodeIgniter
    個人 Github
            https://github.com/appleboy


2011/11/12                      PHP Conference            3
本投影片適合尚未使用過
Framework 且對於 PHP 已經有些
    基礎的 Web Developer



2011/11/12   PHP Conference   4
Why use Framework?

    合作方式 ( 不管你是團隊還是 Soho)
            程式設計師與程式設計師
            程式設計師與前端設計師
    加速開發
            幫你寫好一堆功能模組 ( 分頁 , 驗證碼 , 多國語系 )
            幫你解決安全性問題 ($_GET, $POST ...)




2011/11/12                PHP Conference      5
CodeIgniter 與我




         在 2009 年 1 月
      畢業進入資策會的第 1 份工作



2011/11/12        PHP Conference   6
為了尋找一套適合同事們
          一起共同開發的環境架構
        (Zend, Cake, Symfony, Yii...)



2011/11/12          PHP Conference      7
$this->load->view('Why')



              在眾多 Framework 選擇下
              為什麼要使用 CodeIgniter




2011/11/12            PHP Conference    8
初學者非用 CodeIgniter 的優勢

    懶人安裝方法
    架構清楚明瞭
    繁體中文文件
    基礎 MVC 架構 ( 日後可跳往其它 Framework)




2011/11/12       PHP Conference       9
懶人安裝方法




2011/11/12    PHP Conference   10
下載 + 解壓縮 = 安裝完成
           適用於任何作業系統



2011/11/12     PHP Conference   11
真的這麼容易安裝 ?

    進入下載網址
            http://www.codeigniter.org.tw/downloads
    解壓縮檔案
            unzip CodeIgniter_2.X.X.zip
    輸入網址
            http://your_host_name/codeigniter/




2011/11/12                      PHP Conference         12
$this->load->view('welcome')




2011/11/12         PHP Conference      13
如果安裝失敗呢?




2011/11/12      PHP Conference   14
你還是不要接觸 PHP 會比較好
         ( 開玩笑的 )



2011/11/12   PHP Conference   15
CodeIgniter 架構清楚明瞭




2011/11/12          PHP Conference   16
CodeIgniter 目錄

      application ( 網站主目錄 )
      system (CodeIgniter 核心目錄 )
      user_guide (CodeIgniter 使用手冊 )
             index.php ( 網站主程式 )




2011/11/12               PHP Conference   17
開發多網站目錄架構
             ( 大部份 Framework 做法 )



2011/11/12           PHP Conference   18
多網站目錄架構

         system ( 升級版本只需要換此目錄 )

         web_01
             application
             index.php

        web_02
             application
             index.php
2011/11/12                 PHP Conference   19
簡易清楚繁體中文文件
       ( 解決初學者對於英文的排斥 )
             http://codeigniter.org.tw/user_guide/



2011/11/12                 PHP Conference            20
初學者請直接閱讀一般主題




2011/11/12        PHP Conference   21
必讀資料

    一般主題                                   類別參考
            CodeIgniter URLs                       Database 類別
            控制器 (Controllers)                      Input 類別
            檢視 (Views)                             Loader 類別
            模型 (Models)




2011/11/12                      PHP Conference                     22
進階閱讀

    一般主題                               類別參考
      ●      新增程式庫 (Library)                 ●   Email 類別
      ●      新增核心類別                          ●   File Uploading 類別
      ●      Hooks – 擴充核心                    ●   Form Validation 類別
      ●      URI 路由                          ●   Language 類別
                                             ●   Output 類別
                                             ●   Pagination 類別
                                             ●   Session 類別

2011/11/12                  PHP Conference                           23
以上就是足以讓大家嘗試的理由

             簡單 容易 好上手



2011/11/12      PHP Conference   24
來看看 CodeIgniter 基本 MVC 架構




2011/11/12   PHP Conference   25
MVC Architecture
   Database                                      Layout

    Model       Library                Helper    View




                          Controller



                Routing                Caching


                          Web Server



2011/11/12            Client Browser
                         PHP Conference                   26
撰寫第一個 Hello World




2011/11/12         PHP Conference   27
Hello Appleboy

             View (views/welcome.php)
     View      <html>
                 <body>
                 Hello <?php echo $username; ?>
                 </body>
               </html>




             Controller (controllers/welcome.php)
               function welcome($id) {
Controller
                 $data[‘username’] = $id;
                 $this->load->view(“welcome”, $data);
               }
2011/11/12               PHP Conference                 28
CodeIgniter 功能特性介紹




2011/11/12          PHP Conference   29
自訂 URL




 還在用 Apache 模組 mod_rewrite
    自訂特殊 URL 嘛?


2011/11/12    PHP Conference   30
CodeIgniter 內建自訂 URL 功能

    $route['products/([a-z]+)/(d+)'] = "$1/id_$2"
            products/os/1234
            呼叫 os controller
            傳入參數 id_1234
    網站出現重大問題需要停機修復
            $route['(:any)'] = "system/fix"
            $route['.*'] = “system/fix”



2011/11/12                        PHP Conference      31
High Performance Framework




                CodeIgniter
             預設不會載入未使用模組
               用到時自行載入


2011/11/12        PHP Conference   32
High Performance Framework

    載入 Library
            $this->load->library(array('email', 'table'));
    載入 view
            $this->load->view('file_name');
    載入 model
            $this->load->model('model_name');
    載入 helper
            $this->load->helper('help_name');

2011/11/12                        PHP Conference              33
CodeIgniter Cahe System

                               index


 Cache 存在                   Routing

                           Caching


                   Application Controller

2011/11/12              PHP Conference      34
Cache 使用方式

    Cache 可以寫在 Controller 任意地方
            $this->output->cache(n);
            n 代表分鐘




2011/11/12                      PHP Conference   35
Cache 缺點




             當 expire time 尚未過期

              網頁資訊一定是舊的


2011/11/12          PHP Conference   36
CodeIgniter Cache 機制

    將 time()+n*60 寫入到 cache 檔案最前面
    每次 Request 則取出跟 time() 比對時間
          若 cache time > time() 直接輸出 cache file
          若 cache time < time() 刪除 cache 並且新增 cache


                  缺點 : 適用於靜態檔案


    2011/11/12               PHP Conference            37
如果用在動態檔案呢 ?



    官方無提供刪除 cache 檔案函式
       請自行 Patch 程式碼
                  http://goo.gl/03IrZ
        $this->output->delete_cache('post/12')
        $this->output->delete_cache('post/list')


2011/11/12              PHP Conference             38
支援簡單 Command Line




             CodeIgniter 2.x.x 版本支援
              Windows, Linux crontab
                搭配背景執行處理


2011/11/12            PHP Conference   39
好處

    CLI 去執行您的 cron-jobs 而不需要使用 curl
    互動式 "tasks" 工作 , 像是動態改變權限、清除
     cache 目錄、執行備份…等。
    任意搭配其他程式 , 例如 Perl, C++, Python




2011/11/12         PHP Conference      40
用法




$ php index.php controller method
$ php index.php welcome index


2011/11/12    PHP Conference    41
避免網頁執行到 command line

    將 corn-jobs 移出 apache 可執行目錄
    用 PHP 判斷,確保瀏覽器不能執行 cron-jobs
            php_sapi_name() === "cli"
            defined('STDIN')




2011/11/12                      PHP Conference   42
處理 $_POST,$_GET 資料
      if ( ! isset($_POST['user']))
              $user = FALSE;
      else
              $user = $_POST['user'];

$user = (! isset($_POST['user'])) ? FALSE : $_POST['user'];




 2011/11/12                    PHP Conference            43
不需要這麼麻煩

    $_POST 資料
            $user = $this->input->post('user');
    $_GET 資料
            $user = $this->input->get('user');
    一起判斷
            $user = $this->input->get_post('user');
            先找 $_POST['user'], 後找 $_GET['user']


2011/11/12                       PHP Conference        44
避免 XSS 的攻擊

    $user = $this->input->post('user', TRUE);
    $user = $this->input->get('user', TRUE);
    $user = $this->input->get_post('user', TRUE);




2011/11/12              PHP Conference               45
良好的程式設計

    善用 === 做判斷
    數字請用 intval() 或 (int) 過慮
            $id = intavl($id);
            $id = (int) $id;
    用 is_array, is_int, is_bool, is_string 判斷類型




2011/11/12                        PHP Conference   46
表單驗證

    $this->form_validation->set_rules('username', ' 帳
     號 ', 'trim|required|min_length[5]|max_length[12]|
     xss_clean');
    $this->form_validation->set_rules('password', ' 密
     碼 ', 'trim|required|md5');
    $this->form_validation->set_rules('email', ' 電子郵
     件 ', 'trim|required|valid_email');



    2011/11/12           PHP Conference              47
分頁

    $this->load->library('pagination');
    $config['base_url'] =
     'http://example.com/index.php/test/page/';
    $config['total_rows'] = 200;
    $config['per_page'] = 20;
    $this->pagination->initialize($config);
    echo $this->pagination->create_links();


2011/11/12               PHP Conference           48
Email 寄信

    多重協定 : Mail , Sendmail , and SMTP
    多重收件人
    副本 (CC) 和密件副本 (BCCs)
    支援 HTML 或者是純文字 (Plaintext) 郵件
    附件檔案




2011/11/12          PHP Conference       49
使用方式

    $this->load->library('email');
    $this->email->from('your@example.com', 'Your Name');
    $this->email->to('someone@example.com');
    $this->email->cc('another@another-example.com');
    $this->email->bcc('them@their-example.com');
    $this->email->subject('Email Test');
    $this->email->message('Testing the email class.');
    $this->email->send();
    echo $this->email->print_debugger();
    2011/11/12                PHP Conference                50
影像縮圖功能

    修改影像的尺寸
    建立縮圖
    影像裁剪
    影像旋轉
    浮水印
    支援 GD/GD2 , NetPBM 以及 ImageMagick



2011/11/12         PHP Conference        51
以上只是一些
        CodeIgniter Library 基本介紹
           想了解更多功能請上
               User Guide
             http://goo.gl/7PGnW




2011/11/12         PHP Conference   52
光是 CodeIgniter 內建的功能
           還不能滿足您嘛?



2011/11/12      PHP Conference   53
歡迎使用 http://getsparks.org/




2011/11/12       PHP Conference    54
What is Sparks?




              Ruby 有 RubyGems
               Node.js 有 npm
             CodeIgniter 有 sparks


2011/11/12          PHP Conference   55
What is Sparks?



        Package Management System

                Making Code Easy to
             Find, Create, and Distribute


2011/11/12              PHP Conference      56
Get Sparks tool Now!!




              一行指令就安裝完成
$ php -r "$(curl -fsSL http://getsparks.org/go-sparks)"




 2011/11/12             PHP Conference              57
Installing Sparks with the Spark
                Manager




                http://goo.gl/lHmCX
$ php tools/spark install -v1.0.4 google-url-shortener




 2011/11/12            PHP Conference               58
Load Sparks Library




$this->load->spark(google-url-shortener/1.0.4');
$short_url = $this->google_url_api->shorten($url);
echo $url . " => " . $short_url->id . "<br />";




2011/11/12           PHP Conference              59
好用 sparks 介紹

    ion_auth http://goo.gl/Au4kM
            E-mail 啟動帳號 , 忘記密碼 .. 等
            單一帳號多重群組
            User/Email 雙重認證選擇
            Zend ACL Library 導入權限
            搭配 Facebook, Google Auth API 認證
    Template http://goo.gl/BN5g6
            動態讀取 CSS 或 Javascript

2011/11/12                  PHP Conference     60
CodeIgniter 重大改變 2009->2011

    版本演進 1.7.x → 2.x.x
            捨棄 PHP4
            效能改善
    版本控制
            Bitbucket → Github
            加速大家貢獻




2011/11/12                        PHP Conference   61
如果有任何問題都可以到討論區留言
         http://www.codeigniter.org.tw/forum/




2011/11/12              PHP Conference          62
歡迎加入 CodeIgniter 翻譯




2011/11/12          PHP Conference   63
https://github.com/appleboy/PHP-CodeIgniter-Framework-Taiwan


              縮址 : http://goo.gl/5CU9N



 2011/11/12               PHP Conference                 64
Thank You.




2011/11/12      PHP Conference   65

Contenu connexe

Tendances

[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來Shengyou Fan
 
Composer 從入門到實戰
Composer 從入門到實戰Composer 從入門到實戰
Composer 從入門到實戰Shengyou Fan
 
使用 wagon + VS Code 輕鬆打造 Windows 平台 PHP/Laravel 開發環境
使用 wagon + VS Code 輕鬆打造 Windows 平台 PHP/Laravel 開發環境使用 wagon + VS Code 輕鬆打造 Windows 平台 PHP/Laravel 開發環境
使用 wagon + VS Code 輕鬆打造 Windows 平台 PHP/Laravel 開發環境Shengyou Fan
 
Composer 套件管理
Composer 套件管理Composer 套件管理
Composer 套件管理Shengyou Fan
 
View 與 Blade 樣板引擎
View 與 Blade 樣板引擎View 與 Blade 樣板引擎
View 與 Blade 樣板引擎Shengyou Fan
 
應用程式部署
應用程式部署應用程式部署
應用程式部署Shengyou Fan
 
COSCUP 2016 Laravel 部署工作坊 - 部署指南
COSCUP 2016 Laravel 部署工作坊 - 部署指南COSCUP 2016 Laravel 部署工作坊 - 部署指南
COSCUP 2016 Laravel 部署工作坊 - 部署指南Shengyou Fan
 
Package 安裝與使用
Package 安裝與使用Package 安裝與使用
Package 安裝與使用Shengyou Fan
 
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩Wen-Tien Chang
 
View 與 Blade 樣板引擎
View 與 Blade 樣板引擎View 與 Blade 樣板引擎
View 與 Blade 樣板引擎Shengyou Fan
 
前端工程師一定要知道的 Docker 虛擬化容器技巧
前端工程師一定要知道的 Docker 虛擬化容器技巧前端工程師一定要知道的 Docker 虛擬化容器技巧
前端工程師一定要知道的 Docker 虛擬化容器技巧Chu-Siang Lai
 
CodeIgniter 2.0.X
CodeIgniter 2.0.XCodeIgniter 2.0.X
CodeIgniter 2.0.XBo-Yi Wu
 
Continuous Delivery Workshop with Ansible x GitLab CI
Continuous Delivery Workshop with Ansible x GitLab CIContinuous Delivery Workshop with Ansible x GitLab CI
Continuous Delivery Workshop with Ansible x GitLab CIChu-Siang Lai
 
Model 設定與 Seeding
Model 設定與 SeedingModel 設定與 Seeding
Model 設定與 SeedingShengyou Fan
 
[PHPConf Taiwan 2015] 跟著 Laravel 5.1 一起成為更好的 PHP 開發者
[PHPConf Taiwan 2015] 跟著 Laravel 5.1 一起成為更好的 PHP 開發者[PHPConf Taiwan 2015] 跟著 Laravel 5.1 一起成為更好的 PHP 開發者
[PHPConf Taiwan 2015] 跟著 Laravel 5.1 一起成為更好的 PHP 開發者Shengyou Fan
 
開發環境建置
開發環境建置開發環境建置
開發環境建置Shengyou Fan
 
Continuous Delivery with Ansible x GitLab CI (2e)
Continuous Delivery with Ansible x GitLab CI (2e)Continuous Delivery with Ansible x GitLab CI (2e)
Continuous Delivery with Ansible x GitLab CI (2e)Chu-Siang Lai
 
[PHP 也有 Day #64] PHP 升級指南
[PHP 也有 Day #64] PHP 升級指南[PHP 也有 Day #64] PHP 升級指南
[PHP 也有 Day #64] PHP 升級指南Shengyou Fan
 
Continuous Delivery Workshop with Ansible x GitLab CI (3rd)
Continuous Delivery Workshop with Ansible x GitLab CI (3rd)Continuous Delivery Workshop with Ansible x GitLab CI (3rd)
Continuous Delivery Workshop with Ansible x GitLab CI (3rd)Chu-Siang Lai
 

Tendances (20)

[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
 
Composer 從入門到實戰
Composer 從入門到實戰Composer 從入門到實戰
Composer 從入門到實戰
 
使用 wagon + VS Code 輕鬆打造 Windows 平台 PHP/Laravel 開發環境
使用 wagon + VS Code 輕鬆打造 Windows 平台 PHP/Laravel 開發環境使用 wagon + VS Code 輕鬆打造 Windows 平台 PHP/Laravel 開發環境
使用 wagon + VS Code 輕鬆打造 Windows 平台 PHP/Laravel 開發環境
 
Composer 套件管理
Composer 套件管理Composer 套件管理
Composer 套件管理
 
View 與 Blade 樣板引擎
View 與 Blade 樣板引擎View 與 Blade 樣板引擎
View 與 Blade 樣板引擎
 
應用程式部署
應用程式部署應用程式部署
應用程式部署
 
COSCUP 2016 Laravel 部署工作坊 - 部署指南
COSCUP 2016 Laravel 部署工作坊 - 部署指南COSCUP 2016 Laravel 部署工作坊 - 部署指南
COSCUP 2016 Laravel 部署工作坊 - 部署指南
 
使用者認證
使用者認證使用者認證
使用者認證
 
Package 安裝與使用
Package 安裝與使用Package 安裝與使用
Package 安裝與使用
 
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
 
View 與 Blade 樣板引擎
View 與 Blade 樣板引擎View 與 Blade 樣板引擎
View 與 Blade 樣板引擎
 
前端工程師一定要知道的 Docker 虛擬化容器技巧
前端工程師一定要知道的 Docker 虛擬化容器技巧前端工程師一定要知道的 Docker 虛擬化容器技巧
前端工程師一定要知道的 Docker 虛擬化容器技巧
 
CodeIgniter 2.0.X
CodeIgniter 2.0.XCodeIgniter 2.0.X
CodeIgniter 2.0.X
 
Continuous Delivery Workshop with Ansible x GitLab CI
Continuous Delivery Workshop with Ansible x GitLab CIContinuous Delivery Workshop with Ansible x GitLab CI
Continuous Delivery Workshop with Ansible x GitLab CI
 
Model 設定與 Seeding
Model 設定與 SeedingModel 設定與 Seeding
Model 設定與 Seeding
 
[PHPConf Taiwan 2015] 跟著 Laravel 5.1 一起成為更好的 PHP 開發者
[PHPConf Taiwan 2015] 跟著 Laravel 5.1 一起成為更好的 PHP 開發者[PHPConf Taiwan 2015] 跟著 Laravel 5.1 一起成為更好的 PHP 開發者
[PHPConf Taiwan 2015] 跟著 Laravel 5.1 一起成為更好的 PHP 開發者
 
開發環境建置
開發環境建置開發環境建置
開發環境建置
 
Continuous Delivery with Ansible x GitLab CI (2e)
Continuous Delivery with Ansible x GitLab CI (2e)Continuous Delivery with Ansible x GitLab CI (2e)
Continuous Delivery with Ansible x GitLab CI (2e)
 
[PHP 也有 Day #64] PHP 升級指南
[PHP 也有 Day #64] PHP 升級指南[PHP 也有 Day #64] PHP 升級指南
[PHP 也有 Day #64] PHP 升級指南
 
Continuous Delivery Workshop with Ansible x GitLab CI (3rd)
Continuous Delivery Workshop with Ansible x GitLab CI (3rd)Continuous Delivery Workshop with Ansible x GitLab CI (3rd)
Continuous Delivery Workshop with Ansible x GitLab CI (3rd)
 

En vedette

Tennistavolo- Classifica finale regionale di società - Zona B
Tennistavolo- Classifica finale regionale di società - Zona BTennistavolo- Classifica finale regionale di società - Zona B
Tennistavolo- Classifica finale regionale di società - Zona BGiuliano Ganassi
 
How to choose web framework
How to choose web frameworkHow to choose web framework
How to choose web frameworkBo-Yi Wu
 
Introduction to Grunt.js on Taiwan JavaScript Conference
Introduction to Grunt.js on Taiwan JavaScript ConferenceIntroduction to Grunt.js on Taiwan JavaScript Conference
Introduction to Grunt.js on Taiwan JavaScript ConferenceBo-Yi Wu
 
Git Flow and JavaScript Coding Style
Git Flow and JavaScript Coding StyleGit Flow and JavaScript Coding Style
Git Flow and JavaScript Coding StyleBo-Yi Wu
 
Gearman work queue in php
Gearman work queue in phpGearman work queue in php
Gearman work queue in phpBo-Yi Wu
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to gitBo-Yi Wu
 
Git flow 與團隊合作
Git flow 與團隊合作Git flow 與團隊合作
Git flow 與團隊合作Bo-Yi Wu
 
Why to choose laravel framework
Why to choose laravel frameworkWhy to choose laravel framework
Why to choose laravel frameworkBo-Yi Wu
 
PHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding stylePHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding styleBo-Yi Wu
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golangBo-Yi Wu
 
How to integrate front end tool via gruntjs
How to integrate front end tool via gruntjsHow to integrate front end tool via gruntjs
How to integrate front end tool via gruntjsBo-Yi Wu
 
advanced introduction to codeigniter
advanced introduction to codeigniteradvanced introduction to codeigniter
advanced introduction to codeigniterBo-Yi Wu
 
2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxy
2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxy2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxy
2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxyBo-Yi Wu
 
You must know about CodeIgniter Popular Library
You must know about CodeIgniter Popular LibraryYou must know about CodeIgniter Popular Library
You must know about CodeIgniter Popular LibraryBo-Yi Wu
 
Codeigniter 3.0 之 30 分鐘就上手
Codeigniter 3.0 之 30 分鐘就上手Codeigniter 3.0 之 30 分鐘就上手
Codeigniter 3.0 之 30 分鐘就上手Piece Chao
 
Automating your workflow with Gulp.js
Automating your workflow with Gulp.jsAutomating your workflow with Gulp.js
Automating your workflow with Gulp.jsBo-Yi Wu
 
雲端入侵:郵件攻擊與密碼竊取
雲端入侵:郵件攻擊與密碼竊取雲端入侵:郵件攻擊與密碼竊取
雲端入侵:郵件攻擊與密碼竊取openblue
 
資安入門
資安入門資安入門
資安入門Jyny Chen
 
資訊安全入門
資訊安全入門資訊安全入門
資訊安全入門Tyler Chen
 

En vedette (20)

Tennistavolo- Classifica finale regionale di società - Zona B
Tennistavolo- Classifica finale regionale di società - Zona BTennistavolo- Classifica finale regionale di società - Zona B
Tennistavolo- Classifica finale regionale di società - Zona B
 
How to choose web framework
How to choose web frameworkHow to choose web framework
How to choose web framework
 
Introduction to Grunt.js on Taiwan JavaScript Conference
Introduction to Grunt.js on Taiwan JavaScript ConferenceIntroduction to Grunt.js on Taiwan JavaScript Conference
Introduction to Grunt.js on Taiwan JavaScript Conference
 
Git Flow and JavaScript Coding Style
Git Flow and JavaScript Coding StyleGit Flow and JavaScript Coding Style
Git Flow and JavaScript Coding Style
 
Gearman work queue in php
Gearman work queue in phpGearman work queue in php
Gearman work queue in php
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Git flow 與團隊合作
Git flow 與團隊合作Git flow 與團隊合作
Git flow 與團隊合作
 
Why to choose laravel framework
Why to choose laravel frameworkWhy to choose laravel framework
Why to choose laravel framework
 
PHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding stylePHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding style
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golang
 
How to integrate front end tool via gruntjs
How to integrate front end tool via gruntjsHow to integrate front end tool via gruntjs
How to integrate front end tool via gruntjs
 
advanced introduction to codeigniter
advanced introduction to codeigniteradvanced introduction to codeigniter
advanced introduction to codeigniter
 
2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxy
2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxy2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxy
2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxy
 
You must know about CodeIgniter Popular Library
You must know about CodeIgniter Popular LibraryYou must know about CodeIgniter Popular Library
You must know about CodeIgniter Popular Library
 
Codeigniter 3.0 之 30 分鐘就上手
Codeigniter 3.0 之 30 分鐘就上手Codeigniter 3.0 之 30 分鐘就上手
Codeigniter 3.0 之 30 分鐘就上手
 
Automating your workflow with Gulp.js
Automating your workflow with Gulp.jsAutomating your workflow with Gulp.js
Automating your workflow with Gulp.js
 
雲端入侵:郵件攻擊與密碼竊取
雲端入侵:郵件攻擊與密碼竊取雲端入侵:郵件攻擊與密碼竊取
雲端入侵:郵件攻擊與密碼竊取
 
SQL Injection
SQL InjectionSQL Injection
SQL Injection
 
資安入門
資安入門資安入門
資安入門
 
資訊安全入門
資訊安全入門資訊安全入門
資訊安全入門
 

Similaire à Phpconf 2011 introduction_to_codeigniter

大话Php之性能
大话Php之性能大话Php之性能
大话Php之性能liqiang xu
 
2012 php conf slide PIXNET 如何使用 php
2012 php conf slide   PIXNET 如何使用 php2012 php conf slide   PIXNET 如何使用 php
2012 php conf slide PIXNET 如何使用 phpronnywang_tw
 
PHP & AppServ
PHP & AppServPHP & AppServ
PHP & AppServHt Wang
 
Phalcon the fastest php framework 阿土伯
Phalcon   the fastest php framework 阿土伯Phalcon   the fastest php framework 阿土伯
Phalcon the fastest php framework 阿土伯Hash Lin
 
Phalcon phpconftw2012
Phalcon phpconftw2012Phalcon phpconftw2012
Phalcon phpconftw2012Rack Lin
 
从无阻塞并行脚本加载(Lab.js)到浏览器消息模型
从无阻塞并行脚本加载(Lab.js)到浏览器消息模型从无阻塞并行脚本加载(Lab.js)到浏览器消息模型
从无阻塞并行脚本加载(Lab.js)到浏览器消息模型Jackson Tian
 
Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第一天
Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第一天Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第一天
Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第一天Gelis Wu
 
Php documentor
Php documentorPhp documentor
Php documentorCloud Liao
 
Php documentor
Php documentorPhp documentor
Php documentorCloud Liao
 
第四章解答
第四章解答第四章解答
第四章解答jiannrong
 
基于Symfony框架下的快速企业级应用开发
基于Symfony框架下的快速企业级应用开发基于Symfony框架下的快速企业级应用开发
基于Symfony框架下的快速企业级应用开发mysqlops
 
rebar erlang 2
rebar erlang 2rebar erlang 2
rebar erlang 2致远 郑
 
部分PHP问题总结[转贴]
部分PHP问题总结[转贴]部分PHP问题总结[转贴]
部分PHP问题总结[转贴]wensheng wei
 
Web development overview
Web development overviewWeb development overview
Web development overviewWei Sun
 
Symfony簡介
Symfony簡介Symfony簡介
Symfony簡介Ricky Su
 
通用即时到帐接口集成教程 Php版本
通用即时到帐接口集成教程 Php版本通用即时到帐接口集成教程 Php版本
通用即时到帐接口集成教程 Php版本abdul_manashi
 
通用即时到帐接口集成教程 Php版本
通用即时到帐接口集成教程 Php版本通用即时到帐接口集成教程 Php版本
通用即时到帐接口集成教程 Php版本abdul_manashi
 
Asp.net 5 新功能與變革
Asp.net 5 新功能與變革Asp.net 5 新功能與變革
Asp.net 5 新功能與變革Gelis Wu
 

Similaire à Phpconf 2011 introduction_to_codeigniter (20)

大话Php之性能
大话Php之性能大话Php之性能
大话Php之性能
 
2012 php conf slide PIXNET 如何使用 php
2012 php conf slide   PIXNET 如何使用 php2012 php conf slide   PIXNET 如何使用 php
2012 php conf slide PIXNET 如何使用 php
 
PHP & AppServ
PHP & AppServPHP & AppServ
PHP & AppServ
 
Phalcon the fastest php framework 阿土伯
Phalcon   the fastest php framework 阿土伯Phalcon   the fastest php framework 阿土伯
Phalcon the fastest php framework 阿土伯
 
Phalcon phpconftw2012
Phalcon phpconftw2012Phalcon phpconftw2012
Phalcon phpconftw2012
 
从无阻塞并行脚本加载(Lab.js)到浏览器消息模型
从无阻塞并行脚本加载(Lab.js)到浏览器消息模型从无阻塞并行脚本加载(Lab.js)到浏览器消息模型
从无阻塞并行脚本加载(Lab.js)到浏览器消息模型
 
Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第一天
Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第一天Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第一天
Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第一天
 
Php documentor
Php documentorPhp documentor
Php documentor
 
Php documentor
Php documentorPhp documentor
Php documentor
 
第四章解答
第四章解答第四章解答
第四章解答
 
基于Symfony框架下的快速企业级应用开发
基于Symfony框架下的快速企业级应用开发基于Symfony框架下的快速企业级应用开发
基于Symfony框架下的快速企业级应用开发
 
Html01
Html01Html01
Html01
 
rebar erlang 2
rebar erlang 2rebar erlang 2
rebar erlang 2
 
部分PHP问题总结[转贴]
部分PHP问题总结[转贴]部分PHP问题总结[转贴]
部分PHP问题总结[转贴]
 
Web development overview
Web development overviewWeb development overview
Web development overview
 
Symfony簡介
Symfony簡介Symfony簡介
Symfony簡介
 
通用即时到帐接口集成教程 Php版本
通用即时到帐接口集成教程 Php版本通用即时到帐接口集成教程 Php版本
通用即时到帐接口集成教程 Php版本
 
通用即时到帐接口集成教程 Php版本
通用即时到帐接口集成教程 Php版本通用即时到帐接口集成教程 Php版本
通用即时到帐接口集成教程 Php版本
 
Asp.net 5 新功能與變革
Asp.net 5 新功能與變革Asp.net 5 新功能與變革
Asp.net 5 新功能與變革
 
Demo review
Demo reviewDemo review
Demo review
 

Plus de Bo-Yi Wu

Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Bo-Yi Wu
 
用 Go 語言打造多台機器 Scale 架構
用 Go 語言打造多台機器 Scale 架構用 Go 語言打造多台機器 Scale 架構
用 Go 語言打造多台機器 Scale 架構Bo-Yi Wu
 
Job Queue in Golang
Job Queue in GolangJob Queue in Golang
Job Queue in GolangBo-Yi Wu
 
Golang Project Layout and Practice
Golang Project Layout and PracticeGolang Project Layout and Practice
Golang Project Layout and PracticeBo-Yi Wu
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub ActionsBo-Yi Wu
 
Drone 1.0 Feature
Drone 1.0 FeatureDrone 1.0 Feature
Drone 1.0 FeatureBo-Yi Wu
 
Drone CI/CD Platform
Drone CI/CD PlatformDrone CI/CD Platform
Drone CI/CD PlatformBo-Yi Wu
 
GraphQL IN Golang
GraphQL IN GolangGraphQL IN Golang
GraphQL IN GolangBo-Yi Wu
 
Go 語言基礎簡介
Go 語言基礎簡介Go 語言基礎簡介
Go 語言基礎簡介Bo-Yi Wu
 
drone continuous Integration
drone continuous Integrationdrone continuous Integration
drone continuous IntegrationBo-Yi Wu
 
Gorush: A push notification server written in Go
Gorush: A push notification server written in GoGorush: A push notification server written in Go
Gorush: A push notification server written in GoBo-Yi Wu
 
用 Drone 打造 輕量級容器持續交付平台
用 Drone 打造輕量級容器持續交付平台用 Drone 打造輕量級容器持續交付平台
用 Drone 打造 輕量級容器持續交付平台Bo-Yi Wu
 
用 Go 語言 打造微服務架構
用 Go 語言打造微服務架構用 Go 語言打造微服務架構
用 Go 語言 打造微服務架構Bo-Yi Wu
 
Introduction to Gitea with Drone
Introduction to Gitea with DroneIntroduction to Gitea with Drone
Introduction to Gitea with DroneBo-Yi Wu
 
運用 Docker 整合 Laravel 提升團隊開發效率
運用 Docker 整合 Laravel 提升團隊開發效率運用 Docker 整合 Laravel 提升團隊開發效率
運用 Docker 整合 Laravel 提升團隊開發效率Bo-Yi Wu
 
用 Go 語言實戰 Push Notification 服務
用 Go 語言實戰 Push Notification 服務用 Go 語言實戰 Push Notification 服務
用 Go 語言實戰 Push Notification 服務Bo-Yi Wu
 
用 Go 語言打造 DevOps Bot
用 Go 語言打造 DevOps Bot用 Go 語言打造 DevOps Bot
用 Go 語言打造 DevOps BotBo-Yi Wu
 
A painless self-hosted Git service: Gitea
A painless self-hosted Git service: GiteaA painless self-hosted Git service: Gitea
A painless self-hosted Git service: GiteaBo-Yi Wu
 

Plus de Bo-Yi Wu (18)

Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署
 
用 Go 語言打造多台機器 Scale 架構
用 Go 語言打造多台機器 Scale 架構用 Go 語言打造多台機器 Scale 架構
用 Go 語言打造多台機器 Scale 架構
 
Job Queue in Golang
Job Queue in GolangJob Queue in Golang
Job Queue in Golang
 
Golang Project Layout and Practice
Golang Project Layout and PracticeGolang Project Layout and Practice
Golang Project Layout and Practice
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
 
Drone 1.0 Feature
Drone 1.0 FeatureDrone 1.0 Feature
Drone 1.0 Feature
 
Drone CI/CD Platform
Drone CI/CD PlatformDrone CI/CD Platform
Drone CI/CD Platform
 
GraphQL IN Golang
GraphQL IN GolangGraphQL IN Golang
GraphQL IN Golang
 
Go 語言基礎簡介
Go 語言基礎簡介Go 語言基礎簡介
Go 語言基礎簡介
 
drone continuous Integration
drone continuous Integrationdrone continuous Integration
drone continuous Integration
 
Gorush: A push notification server written in Go
Gorush: A push notification server written in GoGorush: A push notification server written in Go
Gorush: A push notification server written in Go
 
用 Drone 打造 輕量級容器持續交付平台
用 Drone 打造輕量級容器持續交付平台用 Drone 打造輕量級容器持續交付平台
用 Drone 打造 輕量級容器持續交付平台
 
用 Go 語言 打造微服務架構
用 Go 語言打造微服務架構用 Go 語言打造微服務架構
用 Go 語言 打造微服務架構
 
Introduction to Gitea with Drone
Introduction to Gitea with DroneIntroduction to Gitea with Drone
Introduction to Gitea with Drone
 
運用 Docker 整合 Laravel 提升團隊開發效率
運用 Docker 整合 Laravel 提升團隊開發效率運用 Docker 整合 Laravel 提升團隊開發效率
運用 Docker 整合 Laravel 提升團隊開發效率
 
用 Go 語言實戰 Push Notification 服務
用 Go 語言實戰 Push Notification 服務用 Go 語言實戰 Push Notification 服務
用 Go 語言實戰 Push Notification 服務
 
用 Go 語言打造 DevOps Bot
用 Go 語言打造 DevOps Bot用 Go 語言打造 DevOps Bot
用 Go 語言打造 DevOps Bot
 
A painless self-hosted Git service: Gitea
A painless self-hosted Git service: GiteaA painless self-hosted Git service: Gitea
A painless self-hosted Git service: Gitea
 

Phpconf 2011 introduction_to_codeigniter

  • 1. 快速上手 CodeIgniter 吳柏毅 Bo-Yi Wu appleboy http://blog.wu-boy.com/ 2011.11.12 2011 PHP Conference
  • 2. 內容皆採用 創用 CC 姓名標示 相同方式分享 3.0 台灣 授權條款
  • 3. $this->load->view('about/me')  瑞昱半導體股份有限公司  Linux Kernel Driver, Sencha Touch Web App.  CodeIgniter 台灣站長 http://codeigniter.org.tw  翻譯線上文件  提交 Patch 給官方 CodeIgniter  個人 Github  https://github.com/appleboy 2011/11/12 PHP Conference 3
  • 4. 本投影片適合尚未使用過 Framework 且對於 PHP 已經有些 基礎的 Web Developer 2011/11/12 PHP Conference 4
  • 5. Why use Framework?  合作方式 ( 不管你是團隊還是 Soho)  程式設計師與程式設計師  程式設計師與前端設計師  加速開發  幫你寫好一堆功能模組 ( 分頁 , 驗證碼 , 多國語系 )  幫你解決安全性問題 ($_GET, $POST ...) 2011/11/12 PHP Conference 5
  • 6. CodeIgniter 與我 在 2009 年 1 月 畢業進入資策會的第 1 份工作 2011/11/12 PHP Conference 6
  • 7. 為了尋找一套適合同事們 一起共同開發的環境架構 (Zend, Cake, Symfony, Yii...) 2011/11/12 PHP Conference 7
  • 8. $this->load->view('Why') 在眾多 Framework 選擇下 為什麼要使用 CodeIgniter 2011/11/12 PHP Conference 8
  • 9. 初學者非用 CodeIgniter 的優勢  懶人安裝方法  架構清楚明瞭  繁體中文文件  基礎 MVC 架構 ( 日後可跳往其它 Framework) 2011/11/12 PHP Conference 9
  • 10. 懶人安裝方法 2011/11/12 PHP Conference 10
  • 11. 下載 + 解壓縮 = 安裝完成 適用於任何作業系統 2011/11/12 PHP Conference 11
  • 12. 真的這麼容易安裝 ?  進入下載網址  http://www.codeigniter.org.tw/downloads  解壓縮檔案  unzip CodeIgniter_2.X.X.zip  輸入網址  http://your_host_name/codeigniter/ 2011/11/12 PHP Conference 12
  • 15. 你還是不要接觸 PHP 會比較好 ( 開玩笑的 ) 2011/11/12 PHP Conference 15
  • 17. CodeIgniter 目錄 application ( 網站主目錄 ) system (CodeIgniter 核心目錄 ) user_guide (CodeIgniter 使用手冊 ) index.php ( 網站主程式 ) 2011/11/12 PHP Conference 17
  • 18. 開發多網站目錄架構 ( 大部份 Framework 做法 ) 2011/11/12 PHP Conference 18
  • 19. 多網站目錄架構 system ( 升級版本只需要換此目錄 ) web_01 application index.php web_02 application index.php 2011/11/12 PHP Conference 19
  • 20. 簡易清楚繁體中文文件 ( 解決初學者對於英文的排斥 ) http://codeigniter.org.tw/user_guide/ 2011/11/12 PHP Conference 20
  • 22. 必讀資料  一般主題  類別參考  CodeIgniter URLs  Database 類別  控制器 (Controllers)  Input 類別  檢視 (Views)  Loader 類別  模型 (Models) 2011/11/12 PHP Conference 22
  • 23. 進階閱讀  一般主題  類別參考 ● 新增程式庫 (Library) ● Email 類別 ● 新增核心類別 ● File Uploading 類別 ● Hooks – 擴充核心 ● Form Validation 類別 ● URI 路由 ● Language 類別 ● Output 類別 ● Pagination 類別 ● Session 類別 2011/11/12 PHP Conference 23
  • 24. 以上就是足以讓大家嘗試的理由 簡單 容易 好上手 2011/11/12 PHP Conference 24
  • 25. 來看看 CodeIgniter 基本 MVC 架構 2011/11/12 PHP Conference 25
  • 26. MVC Architecture Database Layout Model Library Helper View Controller Routing Caching Web Server 2011/11/12 Client Browser PHP Conference 26
  • 28. Hello Appleboy View (views/welcome.php) View <html> <body> Hello <?php echo $username; ?> </body> </html> Controller (controllers/welcome.php) function welcome($id) { Controller $data[‘username’] = $id; $this->load->view(“welcome”, $data); } 2011/11/12 PHP Conference 28
  • 30. 自訂 URL 還在用 Apache 模組 mod_rewrite 自訂特殊 URL 嘛? 2011/11/12 PHP Conference 30
  • 31. CodeIgniter 內建自訂 URL 功能  $route['products/([a-z]+)/(d+)'] = "$1/id_$2"  products/os/1234  呼叫 os controller  傳入參數 id_1234  網站出現重大問題需要停機修復  $route['(:any)'] = "system/fix"  $route['.*'] = “system/fix” 2011/11/12 PHP Conference 31
  • 32. High Performance Framework CodeIgniter 預設不會載入未使用模組 用到時自行載入 2011/11/12 PHP Conference 32
  • 33. High Performance Framework  載入 Library  $this->load->library(array('email', 'table'));  載入 view  $this->load->view('file_name');  載入 model  $this->load->model('model_name');  載入 helper  $this->load->helper('help_name'); 2011/11/12 PHP Conference 33
  • 34. CodeIgniter Cahe System index Cache 存在 Routing Caching Application Controller 2011/11/12 PHP Conference 34
  • 35. Cache 使用方式  Cache 可以寫在 Controller 任意地方  $this->output->cache(n);  n 代表分鐘 2011/11/12 PHP Conference 35
  • 36. Cache 缺點 當 expire time 尚未過期 網頁資訊一定是舊的 2011/11/12 PHP Conference 36
  • 37. CodeIgniter Cache 機制  將 time()+n*60 寫入到 cache 檔案最前面  每次 Request 則取出跟 time() 比對時間  若 cache time > time() 直接輸出 cache file  若 cache time < time() 刪除 cache 並且新增 cache 缺點 : 適用於靜態檔案 2011/11/12 PHP Conference 37
  • 38. 如果用在動態檔案呢 ? 官方無提供刪除 cache 檔案函式 請自行 Patch 程式碼 http://goo.gl/03IrZ $this->output->delete_cache('post/12') $this->output->delete_cache('post/list') 2011/11/12 PHP Conference 38
  • 39. 支援簡單 Command Line CodeIgniter 2.x.x 版本支援 Windows, Linux crontab 搭配背景執行處理 2011/11/12 PHP Conference 39
  • 40. 好處  CLI 去執行您的 cron-jobs 而不需要使用 curl  互動式 "tasks" 工作 , 像是動態改變權限、清除 cache 目錄、執行備份…等。  任意搭配其他程式 , 例如 Perl, C++, Python 2011/11/12 PHP Conference 40
  • 41. 用法 $ php index.php controller method $ php index.php welcome index 2011/11/12 PHP Conference 41
  • 42. 避免網頁執行到 command line  將 corn-jobs 移出 apache 可執行目錄  用 PHP 判斷,確保瀏覽器不能執行 cron-jobs  php_sapi_name() === "cli"  defined('STDIN') 2011/11/12 PHP Conference 42
  • 43. 處理 $_POST,$_GET 資料 if ( ! isset($_POST['user'])) $user = FALSE; else $user = $_POST['user']; $user = (! isset($_POST['user'])) ? FALSE : $_POST['user']; 2011/11/12 PHP Conference 43
  • 44. 不需要這麼麻煩  $_POST 資料  $user = $this->input->post('user');  $_GET 資料  $user = $this->input->get('user');  一起判斷  $user = $this->input->get_post('user');  先找 $_POST['user'], 後找 $_GET['user'] 2011/11/12 PHP Conference 44
  • 45. 避免 XSS 的攻擊  $user = $this->input->post('user', TRUE);  $user = $this->input->get('user', TRUE);  $user = $this->input->get_post('user', TRUE); 2011/11/12 PHP Conference 45
  • 46. 良好的程式設計  善用 === 做判斷  數字請用 intval() 或 (int) 過慮  $id = intavl($id);  $id = (int) $id;  用 is_array, is_int, is_bool, is_string 判斷類型 2011/11/12 PHP Conference 46
  • 47. 表單驗證  $this->form_validation->set_rules('username', ' 帳 號 ', 'trim|required|min_length[5]|max_length[12]| xss_clean');  $this->form_validation->set_rules('password', ' 密 碼 ', 'trim|required|md5');  $this->form_validation->set_rules('email', ' 電子郵 件 ', 'trim|required|valid_email'); 2011/11/12 PHP Conference 47
  • 48. 分頁  $this->load->library('pagination');  $config['base_url'] = 'http://example.com/index.php/test/page/';  $config['total_rows'] = 200;  $config['per_page'] = 20;  $this->pagination->initialize($config);  echo $this->pagination->create_links(); 2011/11/12 PHP Conference 48
  • 49. Email 寄信  多重協定 : Mail , Sendmail , and SMTP  多重收件人  副本 (CC) 和密件副本 (BCCs)  支援 HTML 或者是純文字 (Plaintext) 郵件  附件檔案 2011/11/12 PHP Conference 49
  • 50. 使用方式  $this->load->library('email');  $this->email->from('your@example.com', 'Your Name');  $this->email->to('someone@example.com');  $this->email->cc('another@another-example.com');  $this->email->bcc('them@their-example.com');  $this->email->subject('Email Test');  $this->email->message('Testing the email class.');  $this->email->send();  echo $this->email->print_debugger(); 2011/11/12 PHP Conference 50
  • 51. 影像縮圖功能  修改影像的尺寸  建立縮圖  影像裁剪  影像旋轉  浮水印  支援 GD/GD2 , NetPBM 以及 ImageMagick 2011/11/12 PHP Conference 51
  • 52. 以上只是一些 CodeIgniter Library 基本介紹 想了解更多功能請上 User Guide http://goo.gl/7PGnW 2011/11/12 PHP Conference 52
  • 53. 光是 CodeIgniter 內建的功能 還不能滿足您嘛? 2011/11/12 PHP Conference 53
  • 55. What is Sparks? Ruby 有 RubyGems Node.js 有 npm CodeIgniter 有 sparks 2011/11/12 PHP Conference 55
  • 56. What is Sparks? Package Management System Making Code Easy to Find, Create, and Distribute 2011/11/12 PHP Conference 56
  • 57. Get Sparks tool Now!! 一行指令就安裝完成 $ php -r "$(curl -fsSL http://getsparks.org/go-sparks)" 2011/11/12 PHP Conference 57
  • 58. Installing Sparks with the Spark Manager http://goo.gl/lHmCX $ php tools/spark install -v1.0.4 google-url-shortener 2011/11/12 PHP Conference 58
  • 59. Load Sparks Library $this->load->spark(google-url-shortener/1.0.4'); $short_url = $this->google_url_api->shorten($url); echo $url . " => " . $short_url->id . "<br />"; 2011/11/12 PHP Conference 59
  • 60. 好用 sparks 介紹  ion_auth http://goo.gl/Au4kM  E-mail 啟動帳號 , 忘記密碼 .. 等  單一帳號多重群組  User/Email 雙重認證選擇  Zend ACL Library 導入權限  搭配 Facebook, Google Auth API 認證  Template http://goo.gl/BN5g6  動態讀取 CSS 或 Javascript 2011/11/12 PHP Conference 60
  • 61. CodeIgniter 重大改變 2009->2011  版本演進 1.7.x → 2.x.x  捨棄 PHP4  效能改善  版本控制  Bitbucket → Github  加速大家貢獻 2011/11/12 PHP Conference 61
  • 62. 如果有任何問題都可以到討論區留言 http://www.codeigniter.org.tw/forum/ 2011/11/12 PHP Conference 62
  • 64. https://github.com/appleboy/PHP-CodeIgniter-Framework-Taiwan 縮址 : http://goo.gl/5CU9N 2011/11/12 PHP Conference 64
  • 65. Thank You. 2011/11/12 PHP Conference 65