| config() | ใช้คืนค่า value ของตัวแปร $config ตาม key ที่กำหนด |
|---|---|
| config_set() | ใช้กำหนดค่าของ $config ในขณะ run time |
| config_load() | ใช้คืนค่า $config ทั้งหมดของ group ที่กำหนด โดยจะคืนค่ามาแบบ array |
| config_clear() | ใช้ลบ $config ที่ Load มา ( ลบใน cache ) |
| instance() | ใช้สร้าง Object Kohana |
| debug() | ใช้คืนค่า Html ที่จัดความสมดุลให้แล้ว |
| lang() | ใช้คืนค่า value ของตัวแปร $lang ตาม key ที่กำหนด |
| key_string() | ใช้คืนค่า ค่าข้อมูล ของ array ที่กำหนด ตาม key ที่กำหนด |
| list_files() | ใช้คืนค่าไฟล์ทั้งหมดใน directory ที่กำหนด |
| find_file() | ใช้คืนค่า path ของไฟล์ที่ค้นหา โดยถ้าหากไม่พบไฟล์ที่กำหนดจะคืนค่า false กลับมา |
| user_agent ( key ) | ใช้คืนค่า ข้อมูล ของ key ที่กำหนด |
| user_agent ( tests, accept ) | ใช้ตรวจสอบว่า เป็น สิ่งที่กำหนด ใช่หรือไม่ |
method:config ( key, slash, required );
return type:string
special:static
content:ใช้คืนค่า value ของตัวแปร $config ตาม key ที่กำหนด ( ตัวแปร config คือค่าที่กำหนดใน folder "system/config" )
example:echo Kohana::config ( "locale.language" );
comment:ตัวแปร key คือ group.key โดย group คือ ชื่อไฟล์ และ key คือ key ของตัวแปร $config ในไฟล์
method:config_set ( key, value );
return type:void
special:static
content:ใช้กำหนดค่าของ $config ในขณะ run time
example:Kohana::config_set ( "locale.language", "th_TH" );
comment:ตัวแปร key คือ group.key โดย group คือ ชื่อไฟล์ และ key คือ key ของตัวแปร $config ในไฟล์
method:config_load ( group, required );
return type:array
special:static
content:ใช้คืนค่า $config ทั้งหมดของ group ที่กำหนด โดยจะคืนค่ามาแบบ array
example:print_r ( Kohana::config_load ( "locale" ) );
method:config_clear ( group );
return type:void
special:static
content:ใช้ลบ $config ที่ Load มา ( ลบใน cache )
example:Kohana::config_clear ( "locale" );
method:instance ();
return type:Object
special:static
content:ใช้สร้าง Object Kohana
example:$kohana = Kohana::instance ();
method:debug ( html_string );
return type:string
special:static
content:ใช้คืนค่า Html ที่จัดความสมดุลให้แล้ว
example:$text = "<b>Kohana</b><i>BambooLabCode</i>"; echo Kohana::debug ( $text );
method:lang ( key );
return type:string
special:static
content:ใช้คืนค่า value ของตัวแปร $lang ตาม key ที่กำหนด ( ที่อยู่ในกล่อง "system/i18n/en_US/.." )
example:echo Kohana::lang ( "cache.resources" );
comment:ตัวแปร key คือ group.key โดย group คือ ชื่อไฟล์ และ key คือ key ของตัวแปร $lang
method:key_string ( key, var_array );
return type:string
special:static
content:ใช้คืนค่า ค่าข้อมูล ของ array ที่กำหนด ตาม key ที่กำหนด
example:$arr = array ( "website"=>"bamboolabcode", "protocol"=>"http" ); echo Kohana::key_string ( "website", $arr );
comment:ถ้าหากว่าตัวแปร var_array เป็นมากกว่า 1 มิติ แล้ว key ที่กำหนดให้กำหนดแบบ key.key ไปเรื่อยๆ
method:list_files ( directory, recursive );
return type:array
special:static
content:ใช้คืนค่าไฟล์ทั้งหมดใน directory ที่กำหนด
example:print_r ( Kohana::list_files ( "mode" ) );
comment:ตัวแปร directory จะให้ใส่ path ตั้งแต่ต่อจาก "application" เท่านั้น
method:find_file ( directory, filename, require, extension );
return type:string
special:static
content:require_once ( Kohana::find_file ( "hooks", "base_data" ) );
example:ตัวแปร filename สามารถใส่เป็น sub directory ได้ เช่น "hooks/data"
method:user_agent ( key );
return type:string
special:static
content:ใช้คืนค่า ข้อมูล ของ key ที่กำหนด
example:echo Kohana::user_agent ( "browser" );
comment:ตัวแปร key ได้แก่ agent, browser, version, platform, mobile, robot, referrer, languages, charsets
method:user_agent ( tests, accept );
return type:boolean
special:static
content:ใช้ตรวจสอบว่า เป็น สิ่งที่กำหนด ใช่หรือไม่
example:if ( Kohana::user_agent ( "is_browser", "IE" ) ) { echo "This is IE browser."; }
comment:ตัวแปร key ได้แก่ is_browser, is_mobile, is_robot, accept_lang, accept_charset