CodeIgniter学习笔记一
生活随笔
收集整理的這篇文章主要介紹了
CodeIgniter学习笔记一
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
2019獨角獸企業重金招聘Python工程師標準>>>
controller示例:
在application\controller下創建hello.php
hello.php代碼
<!-- lang: php --> <?php <!-- lang: php --> //此句用來防止跳過控制器直接訪問hello.php頁面 <!-- lang: php --> if(! defined('BASEPATH')) exit('No direct script access allowed'); <!-- lang: php --> //Hello類,注意類名首字母大寫,繼承核心的控制器類CI_Controller <!-- lang: php --> class Hello extends CI_Controller{ <!-- lang: php --><!-- lang: php -->//類中的一個方法,每個控制器都是一個類,在每個Class里面的function都是一個頁面 <!-- lang: php -->function sayhello($name,$name2){ <!-- lang: php -->echo $name."and".$name2."say hello world!"; <!-- lang: php -->} <!-- lang: php --> } <!-- lang: php --> ?>運行的url: locahost/ci/index.php/hello/sayhello/php/hyz
運行結果:php and hyz say hello world!
運行url中index.php是程序入口,所有的控制器選擇、函數調用及參數傳遞都是通過index.php 后的url傳遞
CodeIgniter框架目錄的文件功能
轉載于:https://my.oschina.net/syc2013/blog/127823
總結
以上是生活随笔為你收集整理的CodeIgniter学习笔记一的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [解决]Win7 操作系统不能安装VMw
- 下一篇: (转)ASIHTTPRequest 详解