تأمين الحياة الافتراضية الخاصة بك!
Your PHP skills tool showed me were I needed to improve and how to do it! "مهارات أظهرت أداة بي الخاص بك لي وكنت بحاجة الى تحسين وكيفية القيام بذلك!"
توم

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 $ = فارغة] ، سلسلة [$ الافتراضي] = فارغة)
AddFormIdentifier ( string $fieldName , string $formName ) الفراغ AddFormIdentifier (سلسلة fieldName $ ، $ سلسلة 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 ]) اسم السلسلة $ ، $ سلسلة نوع ، $ سلسلة isRequired AddField (باطلة ، [سلسلة formName $ = فارغة] ، سلسلة [$ الافتراضي] = فارغة)
  • $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 (سلسلة fieldName $ ، $ سلسلة 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 () الفراغ التحقق من صحة ()

ولم تقدم أي تعليقات.
الصورة الأمن

كتبها سكينر دومينيك
آخر تحديث : 2009/09/23 06:18:22