CI框架隨記2

2021-07-11 02:36:45 字數 884 閱讀 5292

1,/>普通

/>情感

2,true)?>>情感

注意:true意思是預設選中的;1是值

>生活

3,">

4,運算元據庫模型

//新增動作

public function add()else }

?>

* 開啟ar模型         一般文章管理系統會使用到ar模型

$active_record = true;     //可以直接在控制器中$this -> db ->  insert();

5,報錯出現bool的返回方式          輸入類的使用    這樣使用更加安全

$this -> input -> post("abc");    以post的方式接收

$this -> input -> get("abc");      以get的方式接收

¥this -> input -> server("name");

6,全域性函式是在system/core/common.php中編輯定義

7,common.php中的函式定義

//定義成功的提示函式

function success($url , $msg){

heard('content-type:text/html;charset=utf-8');

$url = site_url($url);

echo "";

die; 

function error($msg){

heard('content-type:text/html;charset=utf-8');

echo "";

8,除錯模式

$this -> output -> enable_profiler(true);

ci框架 CI超級物件

目錄結構說明 license.txt 許可協議 user guide 使用者手冊 system 框架核心檔案 index.php 入口檔案 mvc1.入口檔案。唯一乙個讓瀏覽器直接請求的指令碼檔案 2.控制器controller 協調模型和檢視 3.模型 提供資料,儲存資料 4.檢視view 只負責...

CI框架記錄

1.取得 session 資料 可以通過如下的函式來得到 session 陣列的任何資訊 this session userdata item item 是陣列裡的相對應資料的索引。例如,想要獲得 session id,你要使用如下的 session id this session userdata...

CI框架初探

2014年7月3日 17 39 35 簡易版 index.php codeigniter.php 找到控制器類檔案並include 建立例項 執行成員函式 詳細版本 瀏覽器請求 index.php 包含codeigniter.php 接下來的步驟都是在codeigniter.php中執行 包含sys...