From 05f5af32b879f7606bf6c6c4d3cb59e62ed47ddc Mon Sep 17 00:00:00 2001 From: Weichen Lin Date: Fri, 3 May 2013 23:13:57 +0800 Subject: [PATCH 1/2] translate array_helper --- helpers/array_helper.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/helpers/array_helper.html b/helpers/array_helper.html index 5b779bf..277846d 100644 --- a/helpers/array_helper.html +++ b/helpers/array_helper.html @@ -102,6 +102,8 @@

elements()

Lets you fetch a number of items from an array. The function tests whether each of the array indices is set. If an index does not exist it is set to FALSE, or whatever you've specified as the default value via the third parameter. Example:

+

讓你一次從陣列中取得數個元素。給定一個陣列,存放欲取得的陣列索引,此函式將檢查是否每個陣列索引都存在。 +若有不存在的索引,則將值設定為FALSE,或是設定為第三個參數指定的預設值。範例如下:

$array = array(
@@ -115,6 +117,7 @@

elements()

The above will return the following array:

+

以上程式將回傳下面的陣列:

array(
@@ -125,12 +128,14 @@

elements()

You can set the third parameter to any default value you like:

+

你可以由第三個參數設定預設值,當索引不存在時會套用預設值:

$my_shape = elements(array('color', 'shape', 'height'), $array, NULL);

The above will return the following array:

+

以上程式將回傳下面的陣列:

array(
@@ -142,6 +147,7 @@

elements()

This is useful when sending the $_POST array to one of your Models. This prevents users from sending additional POST data to be entered into your tables:

+

當你想要將$_POST陣列傳送給你的Model時,這將會很有用。它可以避免傳送多餘的POST資料給你的Model:

$this->load->model('post_model');
@@ -150,6 +156,7 @@

elements()

This ensures that only the id, title and content fields are sent to be updated.

+

這可以確保僅有id,title及content的值會被送出並更新。

From 454dc2489675205f6571abb7d8c6debcd2a0f0d0 Mon Sep 17 00:00:00 2001 From: Weichen Lin Date: Fri, 3 May 2013 23:30:47 +0800 Subject: [PATCH 2/2] translate array_helper and remove original text --- helpers/array_helper.html | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/helpers/array_helper.html b/helpers/array_helper.html index 277846d..dc5db97 100644 --- a/helpers/array_helper.html +++ b/helpers/array_helper.html @@ -100,10 +100,8 @@

random_element()

elements()

-

Lets you fetch a number of items from an array. The function tests whether each of the array indices is set. If an index does not exist -it is set to FALSE, or whatever you've specified as the default value via the third parameter. Example:

-

讓你一次從陣列中取得數個元素。給定一個陣列,存放欲取得的陣列索引,此函式將檢查是否每個陣列索引都存在。 -若有不存在的索引,則將值設定為FALSE,或是設定為第三個參數指定的預設值。範例如下:

+

讓你從陣列中取回多個指定的元素。給定一個陣列,其中存放欲取得的陣列索引,此函式將檢查是否每個陣列索引都存在。 +回傳值是一個含有你指定索引的陣列及其值,若有不存在的索引,則其值將設定為預設值FALSE。亦可透過第三個參數來指定其預設值。範例如下:

$array = array(
@@ -116,7 +114,6 @@

elements()

$my_shape = elements(array('color', 'shape', 'height'), $array);
-

The above will return the following array:

以上程式將回傳下面的陣列:

@@ -127,14 +124,12 @@

elements()

);
-

You can set the third parameter to any default value you like:

你可以由第三個參數設定預設值,當索引不存在時會套用預設值:

$my_shape = elements(array('color', 'shape', 'height'), $array, NULL);
-

The above will return the following array:

以上程式將回傳下面的陣列:

@@ -145,9 +140,7 @@

elements()

);
-

This is useful when sending the $_POST array to one of your Models. This prevents users from -sending additional POST data to be entered into your tables:

-

當你想要將$_POST陣列傳送給你的Model時,這將會很有用。它可以避免傳送多餘的POST資料給你的Model:

+

當你想要將$_POST陣列傳送給Model時,這將會很有用。它可以避免傳送多餘的資料給你的Model:

$this->load->model('post_model');
@@ -155,8 +148,7 @@

elements()

$this->post_model->update(elements(array('id', 'title', 'content'), $_POST));
-

This ensures that only the id, title and content fields are sent to be updated.

-

這可以確保僅有id,title及content的值會被送出並更新。

+

這可以確保僅有id,title及content的值會被送出及更新。