亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

ディレクトリ 検索
歡迎 目錄 快速參考圖 基本信息 服務(wù)器要求 許可協(xié)議 變更記錄 關(guān)于CodeIgniter 安裝 下載 CodeIgniter 安裝指導(dǎo) 從老版本升級(jí) 疑難解答 介紹 開始 CodeIgniter 是什么? CodeIgniter 速記表 支持特性 應(yīng)用程序流程圖 模型-視圖-控制器 架構(gòu)目標(biāo) 教程 內(nèi)容提要 加載靜態(tài)內(nèi)容 創(chuàng)建新聞條目 讀取新聞條目 結(jié)束語 常規(guī)主題 CodeIgniter URL 控制器 保留字 視圖 模型 輔助函數(shù) 使用 CodeIgniter 類庫 創(chuàng)建你自己的類庫 使用 CodeIgniter 適配器 創(chuàng)建適配器 創(chuàng)建核心系統(tǒng)類 鉤子 - 擴(kuò)展框架的核心 自動(dòng)裝載資源 公共函數(shù) URI 路由 錯(cuò)誤處理 緩存 調(diào)試應(yīng)用程序 以CLI方式運(yùn)行 管理應(yīng)用程序 處理多環(huán)境 PHP替代語法 安全 開發(fā)規(guī)范 類庫參考 基準(zhǔn)測(cè)試類 日歷類 購物車類 配置類 Email 類 加密類 文件上傳類 表單驗(yàn)證詳解 FTP 類 圖像處理類 輸入類 Javascript 類 語言類 裝載類 遷移類 輸出類 分頁類 模板解析器類 安全類 Session 類 HTML 表格類 引用通告類 排版類 單元測(cè)試類 URI 類 User-Agent 類 表單驗(yàn)證 XML-RPC 和 XML-RPC 服務(wù)器 Zip 編碼類 緩存適配器 適配器參考 適配器 數(shù)據(jù)庫類 Active Record 類 數(shù)據(jù)庫緩存類 自定義函數(shù)調(diào)用 數(shù)據(jù)庫配置 連接你的數(shù)據(jù)庫 數(shù)據(jù)庫快速入門例子代碼 字段數(shù)據(jù) 數(shù)據(jù)庫維護(hù)類 查詢輔助函數(shù) 數(shù)據(jù)庫類 查詢 生成查詢記錄集 表數(shù)據(jù) 事務(wù) 數(shù)據(jù)庫工具類 JavaScript類 輔助函數(shù)參考 數(shù)組輔助函數(shù) CAPTCHA 輔助函數(shù) Cookie Helper 日期輔助函數(shù) 目錄輔助函數(shù) 下載輔助函數(shù) Email 輔助函數(shù) 文件輔助函數(shù) 表單輔助函數(shù) HTML輔助函數(shù) Inflector 輔助函數(shù) 語言輔助函數(shù) 數(shù)字輔助函數(shù) 路徑輔助函數(shù) 安全輔助函數(shù) 表情輔助函數(shù) 字符串輔助函數(shù) 文本輔助函數(shù) 排版輔助函數(shù) URL 輔助函數(shù) XML 輔助函數(shù)
テキスト

CodeIgniter 用戶指南 版本 2.1.0

編輯文檔、查看近期更改請(qǐng) 登錄 或 注冊(cè)  找回密碼
查看原文

以CLI方式運(yùn)行

除了可以在瀏覽器中通過URL調(diào)用一個(gè) 控制器 外,也可以通過命令行接口(CLI)調(diào)用。

  • 什么是CLI?
  • 為什么使用這種方式?
  • 它如何工作?

什么是CLI?

命令行接口是一種基于文本的和計(jì)算機(jī)交互的方式。 如果想查看更詳細(xì)說明,請(qǐng)看Wikipedia article.

為什么使用命令行?

雖然不是必須的,但在某些情況下我們會(huì)用到命令行

  • Run your cron-jobs without needing to use wget or curl
  • Make your cron-jobs inaccessible from being loaded in the URL by checking for $this->input->is_cli_request()
  • Make interactive "tasks" that can do things like set permissions, prune cache folders, run backups, etc.
  • Integrate with other applications in other languages. For example, a random C++ script could call one command and run code in your models!

Let's try it:? Hello World!

Let's create a simple controller so you can see it in action. Using your text editor, create a file called tools.php, and put the following code in it:

Then save the file to your application/controllers/ folder.

Now normally you would visit the your site using a URL similar to this:

example.com/index.php/tools/message/to

Instead, we are going to open Terminal in Mac/Linux or go to Run > "cmd" in Windows and navigate to our CodeIgniter project.

$ cd /path/to/project;
$ php index.php tools message

If you did it right, you should see Hello World!.

$ php index.php tools message "John Smith"

Here we are passing it a argument in the same way that URL parameters work. "John Smith" is passed as a argument and output is: Hello John Smith!.

That's it!

That, in a nutshell, is all there is to know about controllers on the command line. Remember that this is just a normal controller, so routing and _remap works fine.

?

翻譯貢獻(xiàn)者: baiyuxiong, Hex, tinsn, yinsigan
最后修改: 2012-03-29 14:11:25
前の記事: 次の記事: