Methods summary
public static
|
#
find( string $key, mixed $default = null, mixed $value_key = null )
ค้นหาข้อความภาษาที่ต้องการ ถ้าไม่พบคืนค่า $default
ถ้าไม่ระบุ $default (null) คืนค่า $key
ถ้าระบุ $value_key มาด้วยและ ค่าของภาษาเป็นแอเรย์ จะคืนค่า แอเรย์ของภาษาที่ $value_key
ถ้าไม่พบข้อมูลที่เลือกคืนค่า null.
ค้นหาข้อความภาษาที่ต้องการ ถ้าไม่พบคืนค่า $default
ถ้าไม่ระบุ $default (null) คืนค่า $key
ถ้าระบุ $value_key มาด้วยและ ค่าของภาษาเป็นแอเรย์ จะคืนค่า แอเรย์ของภาษาที่ $value_key
ถ้าไม่พบข้อมูลที่เลือกคืนค่า null.
Parameters
Assert
('XYZ', array()) [==] array()
('YEAR_OFFSET') [==] 543
('DATE_LONG', null, 0) [==] 'อาทิตย์'
('not found', 'default') [==] 'default'
|
public static
mixed
|
#
get( string $key, mixed $default = null )
ฟังก์ชั่นอ่านภาษาที่
ถ้าไม่พบ $key ที่ต้อง
$default = null (หรือไม่ระบุ) คืนค่า $key
$default = อื่นๆ คืนค่า $default
ฟังก์ชั่นอ่านภาษาที่
ถ้าไม่พบ $key ที่ต้อง
$default = null (หรือไม่ระบุ) คืนค่า $key
$default = อื่นๆ คืนค่า $default
Parameters
- $key
- ข้อความในภาษาอังกฤษ หรือ คีย์ของภาษา
- $default
- ถ้าไม่ระบุ (null) และไม่พบ $key
Returns
mixed
Assert
('YEAR_OFFSET') [==] 543
('XYZ', array()) [==] array()
|
public static
array
|
#
getItems( array $keys = array() )
อ่านภาษาหลายรายการ ตามที่กำหนดโดย $keys.
อ่านภาษาหลายรายการ ตามที่กำหนดโดย $keys.
Parameters
Returns
array
|
public static
array
|
#
installed( string $type )
โหลดไฟล์ภาษาทั้งหมดที่ติดตั้ง
คืนค่าข้อมูลภาษาทั้งหมด.
โหลดไฟล์ภาษาทั้งหมดที่ติดตั้ง
คืนค่าข้อมูลภาษาทั้งหมด.
Parameters
Returns
array
|
public static
array
|
|
public static
integer
|
#
keyExists( array $languages, string $key )
ตรวจสอบคีย์ของภาษาซ้ำ
คืนค่าลำดับที่พบ (รายการแรกคือ 0), คืนค่า -1 ถ้าไม่พบ.
ตรวจสอบคีย์ของภาษาซ้ำ
คืนค่าลำดับที่พบ (รายการแรกคือ 0), คืนค่า -1 ถ้าไม่พบ.
Parameters
- $languages
- ข้อมูลภาษาที่ต้องการตรวจสอบ
- $key
- รายการที่ต้องการตรวจสอบ
Returns
integer
Assert
(array(array('id' => 0, 'key' => 'One'), array('id' => 100, 'key' => 'Two')), 'One') [==] 0
(array(array('id' => 0, 'key' => 'One'), array('id' => 100, 'key' => 'Two')), 'two') [==] 100
(array(array('id' => 0, 'key' => 'One'), array('id' => 100, 'key' => 'Two')), 'O') [==] -1
|
public static
string
|
#
languageFolder( )
ฟังก์ชั่นอ่านชื่อโฟลเดอร์เก็บไฟล์ภาษา.
ฟังก์ชั่นอ่านชื่อโฟลเดอร์เก็บไฟล์ภาษา.
Returns
string
|
public static
string
|
#
name( )
อ่านชื่อภาษาที่กำลังใช้งานอยู่.
อ่านชื่อภาษาที่กำลังใช้งานอยู่.
Returns
string
Assert
() [==] 'th'
|
public static
string
|
#
setName( string $language )
กำหนดภาษาที่ต้องการ
Parameters
Returns
string
|
public static
string
|
#
parse( array $match )
ฟังก์ชั่นแปลภาษาที่รับค่ามาจากการ parse Theme.
ฟังก์ชั่นแปลภาษาที่รับค่ามาจากการ parse Theme.
Parameters
- $match
- ตัวแปรรับค่ามาจากการ parse Theme
Returns
string
Assert
(array(1 => 'not found')) [==] 'not found'
|
public static
mixed
|
#
replace( string $key, array $replace )
ฟังก์ชั่นอ่านภาษา.
Parameters
- $key
- ข้อความในภาษาอังกฤษ หรือ คีย์ของภาษา
- $replace
- ข้อความที่จะนำมาแทนที่เช่น array(':key' => 'value', ':key' => 'value')
Returns
mixed
Assert
('You want to :action', array(':action' => 'delete')) [==] 'You want to delete'
|
public static
string
|
#
save( array $languages, string $type )
บันทึกไฟล์ภาษา.
Parameters
Returns
string
|
public static
string
|
#
trans( string $content )
แปลภาษา.
Parameters
Returns
string
Assert
('ภาษา {LNG_DATE_FORMAT} ไทย') [==] 'ภาษา d M Y เวลา H:i น. ไทย'
|