I've learnt so much after subscribing to read your exclusive articles! 我已經學會了訂閱閱讀獨家稿件後,這麼多!
缺口

RocksForm類

說明

實現接口:

  • RocksIValidatable

這代表在頁面上的一種形式。

這簡化了常見的問題與表單處理和驗證。

  • Dominic Skinner 作者:玫瑰斯金納
  • 0.2.1 版本:0.2.1

)位於/ RocksForm.php(第15行)

方法摘要
__construct () RocksForm __construct ()
AddEqualToComparison ( string $itemOne , string $itemTwo , string $message ) 無效 AddEqualToComparison字符串 $ itemOne, 字符串 $ itemTwo, 字符串 消息
AddField ( string $name , string $type , string $isRequired , [ string $formName = null ], [ string $default = null ]) 無效 AddField字符串 $名稱字符串 $類型字符串 $ isRequired, 字符串 $ formName = NULL],[ 字符串 $默認 = NULL])
AddFormIdentifier ( string $fieldName , string $formName ) 無效 AddFormIdentifier字符串 字段名字符串 $ formName)
AddItemOneGreaterThanTwoComparison ( string $itemOne , string $itemTwo , string $message ) 無效 AddItemOneGreaterThanTwoComparison字符串 $ itemOne, 字符串 $ itemTwo, 字符串 消息
AddItemOneLessThanTwoComparison ( string $itemOne , string $itemTwo , string $message ) 無效 AddItemOneLessThanTwoComparison字符串 $ itemOne, 字符串 $ itemTwo, 字符串 消息
AddNotEqualToComparison ( string $itemOne , string $itemTwo , string $message ) 無效 AddNotEqualToComparison字符串 $ itemOne, 字符串 $ itemTwo, 字符串 消息
GetCurrentForm () 無效 GetCurrentForm ()
GetErrors () 無效 GetErrors ()
GetField ( string $name ) RocksFormField GetField字符串 $名稱
SetFormType ( string $type )字符串 $類型 無效 SetFormType
Validate () 無效 驗證 ()
方法
(line 29 ) 構造__construct(29行)
  • public 訪問:公共
__construct () RocksForm __construct()
(line 162 ) AddEqualToComparison(162線)

添加一個比較平等的。 這檢查表單字段的值是相等的,如果他們不那麼的消息顯示。

  • public 訪問:公共
AddEqualToComparison ( string $itemOne , string $itemTwo , string $message ) 無效 AddEqualToComparison( 字符串 $ itemOne, 字符串 $ itemTwo, 字符串 消息
  • $itemOne : this is the name of the first field to compare 字符串 $ itemOne:這是第一個字段的名稱進行比較
  • $itemTwo : this is the name of the second field to compare 字符串 $ itemTwo:這是第二個字段的名稱來比較
  • $message : this is message that is displayed if the fields are not equal 字符串 $消息 :這是顯示的信息是,如果字段不等於
(line 134 ) AddField(134行)

這種方法增加了另一個領域的形式。 你需要添加一個字段的形式返回關聯數組中的價值,以及執行它valudation。

  • public 訪問:公共
AddField ( string $name , string $type , string $isRequired , [ string $formName = null ], [ string $default = null ]) 無效 AddField( 字符串 $名稱字符串 $類型字符串 $ isRequired, 字符串 $ formName = NULL],[ 字符串 $默認 = NULL])
  • $name : this is the name of the form field 字符串 名稱 :這是表單域的名稱
  • $type : this is the type of the form field 字符串 $類型 :這是表單字段的類型
  • $isRequired : this indicates if the field is a required field 字符串 $ isRequired:這表明如果該字段是必填字段
  • $formName : this is the form name that field is part of. 字符串 $ formName:這是表單的名稱,字段的一部分。 這是不需要的,如果只有一個形式
  • $default : this is the default value of the field if it is left empty. 字符串 $默認 :這是字段的默認值,如果它為空
(line 81 ) AddFormIdentifier(81線)

這增加了一個獨特的形式標識符,這表明一個表單域只屬於頁面上的一種形式。 注意:如果有不止一個頁面上的形式,你只需要使用此方法。

  • public 訪問:公共
AddFormIdentifier ( string $fieldName , string $formName ) 無效 AddFormIdentifier( 字符串 字段名字符串 $ formName)
  • $fieldName : this is the field name that uniquely identifies the form 字符串 $ fieldName的 :這是字段的名稱,唯一標識的形式
  • $formName : this is the form name that you want to assign to the form 字符串 $ formName:這是你想要的形式分配給窗體的名稱
(line 188 ) AddItemOneGreaterThanTwoComparison(188行)

添加一個項目一個是比兩個項目比較大。 這支票,表單域的項目之一值是大於項目兩個,如果他們不那麼消息顯示。

  • public 訪問:公共
AddItemOneGreaterThanTwoComparison ( string $itemOne , string $itemTwo , string $message ) 無效 AddItemOneGreaterThanTwoComparison( 字符串 $ itemOne, 字符串 $ itemTwo, 字符串 消息
  • $itemOne : this is the name of the first field to compare 字符串 $ itemOne:這是第一個字段的名稱進行比較
  • $itemTwo : this is the name of the second field to compare 字符串 $ itemTwo:這是第二個字段的名稱來比較
  • $message : this is message that is displayed if the validation fails 字符串 $消息 :這是如果驗證失敗,顯示的信息
(line 201 ) AddItemOneLessThanTwoComparison(201行)

增加一個項目一個是比兩個項目比較少。 這支票,表單域的項目之一值是小於項目兩個,如果他們不那麼消息顯示。

  • public 訪問:公共
AddItemOneLessThanTwoComparison ( string $itemOne , string $itemTwo , string $message ) 無效 AddItemOneLessThanTwoComparison( 字符串 $ itemOne, 字符串 $ itemTwo, 字符串 消息
  • $itemOne : this is the name of the first field to compare 字符串 $ itemOne:這是第一個字段的名稱進行比較
  • $itemTwo : this is the name of the second field to compare 字符串 $ itemTwo:這是第二個字段的名稱來比較
  • $message : this is message that is displayed if the validation fails 字符串 $消息 :這是如果驗證失敗,顯示的信息
(line 175 ) AddNotEqualToComparison(175行)

添加不等於一個比較。 這將檢查表單字段的值不相等,如果他們不那麼消息顯示。

  • public 訪問:公共
AddNotEqualToComparison ( string $itemOne , string $itemTwo , string $message ) 無效 AddNotEqualToComparison( 字符串 $ itemOne, 字符串 $ itemTwo, 字符串 消息
  • $itemOne : this is the name of the first field to compare 字符串 $ itemOne:這是第一個字段的名稱進行比較
  • $itemTwo : this is the name of the second field to compare 字符串 $ itemTwo:這是第二個字段的名稱來比較
  • $message : this is message that is displayed if the fields are equal 字符串 $消息 :這是信息顯示領域的平等
(line 43 ) GetAssociativeArrayData(43行)

這將返回一個關聯數組作為鍵和值的字段值的字段的名稱。

  • public 訪問:公共
GetAssociativeArrayData () 無效 GetAssociativeArrayData()
(line 106 ) GetCurrentForm(106行)

這將返回剛剛調回的形式。

  • public 訪問:公共
GetCurrentForm () 無效 GetCurrentForm()
(line 209 ) GetErrors(209行)

這將返回一個錯誤消息的數組。 這也可以確保如果這就是所謂的形式已經得到驗證。

  • public 訪問:公共
GetErrors () 無效 GetErrors()
(line 145 ) GetField(145行)

基於它的名字,該方法返回一個領域

  • public 訪問:公共
GetField ( string $name ) RocksFormField GetField( 字符串 $名稱
  • $name : this is the name of the form field to return 字符串 名稱 :這是返回的表單域的名稱
(line 66 ) SetFormType(66行)

這集的形式類型

  • public 訪問:公共
SetFormType ( string $type )字符串 $類型 無效 SetFormType)
  • $type : this sets the type of form RocksPost or RocksGet 字符串 $類型 :這台形式RocksPost或RocksGet
(line 222 ) 驗證 (222行)

這將檢查所有的表單域通過所有的驗證測試。

  • public 訪問:公共
Validate () void 驗證 ()

最新的評論:1。 第1頁共1頁。 平均評分:
1:26am on Saturday, December 3rd, 2011 徐子淇 1:26星期六上午,12月3日,2011
下跌下床情緒低落。 這brightneed我的天

安全形象

作者由Dominic斯金納
最後更新:2011年10月25日16點00分38秒