XOOPS प्रपत्र तत्व
अवलोकन
Section titled “अवलोकन”XOOPS अपने XoopsFormElement वर्ग पदानुक्रम के माध्यम से फॉर्म तत्वों का एक व्यापक सेट प्रदान करता है। ये तत्व वेब फॉर्म के लिए रेंडरिंग, सत्यापन और डेटा प्रोसेसिंग को संभालते हैं।
प्रपत्र तत्व पदानुक्रम
Section titled “प्रपत्र तत्व पदानुक्रम”classDiagram class XoopsFormElement { +getName() +getCaption() +render() +setValue() +getValue() }
XoopsFormElement <|-- XoopsFormText XoopsFormElement <|-- XoopsFormTextArea XoopsFormElement <|-- XoopsFormSelect XoopsFormElement <|-- XoopsFormCheckBox XoopsFormElement <|-- XoopsFormRadio XoopsFormElement <|-- XoopsFormButton XoopsFormElement <|-- XoopsFormHidden XoopsFormElement <|-- XoopsFormFile XoopsFormElement <|-- XoopsFormLabel XoopsFormElement <|-- XoopsFormPassword XoopsFormElement <|-- XoopsFormDateTimeटेक्स्ट इनपुट तत्व
Section titled “टेक्स्ट इनपुट तत्व”XoopsFormText
Section titled “XoopsFormText”एकल-पंक्ति पाठ इनपुट:
use XoopsFormText;
$element = new XoopsFormText( caption: 'Username', name: 'username', size: 30, maxlength: 50, value: $currentValue);XoopsFormPassword
Section titled “XoopsFormPassword”मास्किंग के साथ पासवर्ड इनपुट:
use XoopsFormPassword;
$element = new XoopsFormPassword( caption: 'Password', name: 'password', size: 30, maxlength: 100);XoopsFormTextArea
Section titled “XoopsFormTextArea”बहु-पंक्ति पाठ इनपुट:
use XoopsFormTextArea;
$element = new XoopsFormTextArea( caption: 'Description', name: 'description', value: $currentValue, rows: 5, cols: 50);चयन तत्व
Section titled “चयन तत्व”XoopsFormSelect
Section titled “XoopsFormSelect”ड्रॉपडाउन चयन:
use XoopsFormSelect;
$element = new XoopsFormSelect( caption: 'Category', name: 'category_id', value: $selected, size: 1, multiple: false);
$element->addOption(1, 'Category 1');$element->addOption(2, 'Category 2');$element->addOptionArray([ 3 => 'Category 3', 4 => 'Category 4']);XoopsFormCheckBox
Section titled “XoopsFormCheckBox”चेकबॉक्स इनपुट:
use XoopsFormCheckBox;
$element = new XoopsFormCheckBox( caption: 'Features', name: 'features', value: $selected);
$element->addOption('comments', 'Enable Comments');$element->addOption('ratings', 'Enable Ratings');XoopsFormRadio
Section titled “XoopsFormRadio”रेडियो बटन समूह:
use XoopsFormRadio;
$element = new XoopsFormRadio( caption: 'Status', name: 'status', value: $currentValue);
$element->addOption('draft', 'Draft');$element->addOption('published', 'Published');$element->addOption('archived', 'Archived');फ़ाइल अपलोड
Section titled “फ़ाइल अपलोड”XoopsFormFile
Section titled “XoopsFormFile”फ़ाइल अपलोड इनपुट:
use XoopsFormFile;
$element = new XoopsFormFile( caption: 'Upload Image', name: 'image');
$element->setMaxFileSize(2 * 1024 * 1024); // 2MBदिनांक और समय
Section titled “दिनांक और समय”XoopsFormDateTime
Section titled “XoopsFormDateTime”दिनांक/समय चयनकर्ता:
use XoopsFormDateTime;
$element = new XoopsFormDateTime( caption: 'Publish Date', name: 'publish_date', size: 15, value: time());विशेष तत्व
Section titled “विशेष तत्व”XoopsFormHidden
Section titled “XoopsFormHidden”छिपा हुआ क्षेत्र:
use XoopsFormHidden;
$element = new XoopsFormHidden('article_id', $articleId);XoopsFormLabel
Section titled “XoopsFormLabel”केवल-प्रदर्शन लेबल:
use XoopsFormLabel;
$element = new XoopsFormLabel( caption: 'Created By', value: $authorName);XoopsFormButton
Section titled “XoopsFormButton”प्रपत्र बटन:
use XoopsFormButton;
// Submit button$submit = new XoopsFormButton('', 'submit', 'Save', 'submit');
// Reset button$reset = new XoopsFormButton('', 'reset', 'Reset', 'reset');तत्व अनुकूलन
Section titled “तत्व अनुकूलन”CSS कक्षाएं जोड़ना
Section titled “CSS कक्षाएं जोड़ना”$element->setExtra('class="form-control custom-class"');कस्टम विशेषताएँ जोड़ना
Section titled “कस्टम विशेषताएँ जोड़ना”$element->setExtra('data-validate="required" placeholder="Enter text..."');सेटिंग विवरण
Section titled “सेटिंग विवरण”$element->setDescription('Enter a unique username (3-20 characters)');संबंधित दस्तावेज़ीकरण
Section titled “संबंधित दस्तावेज़ीकरण”- प्रपत्र अवलोकन
- प्रपत्र सत्यापन
- कस्टम रेंडरर्स