ऐपएमएल डेटा
AppML का मुख्य उद्देश्य HTML पृष्ठों को डेटा प्रदान करना है।
AppML को डेटा से कनेक्ट करना
- AppML चर से डेटा प्रदर्शित कर सकता है
- ऐपएमएल फाइलों से डेटा प्रदर्शित कर सकता है
- AppML डेटाबेस से डेटा प्रदर्शित कर सकता है
एपीपीएमएल एक जावास्क्रिप्ट ऑब्जेक्ट का उपयोग कर रहा है
HTML और डेटा को अलग करने का एक सामान्य तरीका डेटा को JavaScript ऑब्जेक्ट में संग्रहीत करना है।
उदाहरण
<table appml-data="dataObj">
<tr>
<th>Customer</th>
<th>City</th>
<th>Country</th>
</tr>
<tr appml-repeat="records">
<td>{{CustomerName}}</td>
<td>{{City}}</td>
<td>{{Country}}</td>
</tr>
</table>
<script>
var dataObj = {
"records":[
{"CustomerName":"Alfreds Futterkiste","City":"Berlin","Country":"Germany"},
{"CustomerName":"Ana Trujillo Emparedados y helados","City":"México D.F.","Country":"Mexico"},
{"CustomerName":"Antonio Moreno Taquería","City":"México D.F.","Country":"Mexico"},
{"CustomerName":"Around the Horn","City":"London","Country":"UK"},
{"CustomerName":"B's
Beverages","City":"London","Country":"UK"},
{"CustomerName":"Berglunds
snabbköp","City":"Luleå","Country":"Sweden"},
{"CustomerName":"Blauer See
Delikatessen","City":"Mannheim","Country":"Germany"},
{"CustomerName":"Blondel
père et fils","City":"Strasbourg","Country":"France"},
{"CustomerName":"Bólido
Comidas preparadas","City":"Madrid","Country":"Spain"},
{"CustomerName":"Bon
app'","City":"Marseille","Country":"France"},
{"CustomerName":"Bottom-Dollar
Marketse","City":"Tsawassen","Country":"Canada"},
{"CustomerName":"Cactus
Comidas para llevar","City":"Buenos Aires","Country":"Argentina"},
{"CustomerName":"Centro
comercial Moctezuma","City":"México D.F.","Country":"Mexico"},
{"CustomerName":"Chop-suey Chinese","City":"Bern","Country":"Switzerland"},
{"CustomerName":"Comércio Mineiro","City":"São Paulo","Country":"Brazil"}
]};
</script>
एक JSON फ़ाइल का उपयोग कर AppML
HTML और डेटा को अलग करने का एक अन्य सामान्य तरीका, डेटा को JSON फ़ाइल में संग्रहीत करना है:
ग्राहक.जेएस
{
"records":[
{"CustomerName":"Alfreds Futterkiste","City":"Berlin","Country":"Germany"},
{"CustomerName":"Ana Trujillo Emparedados y helados","City":"México D.F.","Country":"Mexico"},
{"CustomerName":"Antonio Moreno Taquería","City":"México D.F.","Country":"Mexico"},
{"CustomerName":"Around the Horn","City":"London","Country":"UK"},
{"CustomerName":"B's Beverages","City":"London","Country":"UK"},
{"CustomerName":"Berglunds
snabbköp","City":"Luleå","Country":"Sweden"},
{"CustomerName":"Blauer See
Delikatessen","City":"Mannheim","Country":"Germany"},
{"CustomerName":"Blondel
père et fils","City":"Strasbourg","Country":"France"},
{"CustomerName":"Bólido
Comidas preparadas","City":"Madrid","Country":"Spain"},
{"CustomerName":"Bon
app'","City":"Marseille","Country":"France"},
{"CustomerName":"Bottom-Dollar
Marketse","City":"Tsawassen","Country":"Canada"},
{"CustomerName":"Cactus
Comidas para llevar","City":"Buenos Aires","Country":"Argentina"},
{"CustomerName":"Centro
comercial Moctezuma","City":"México D.F.","Country":"Mexico"},
{"CustomerName":"Chop-suey Chinese","City":"Bern","Country":"Switzerland"},
{"CustomerName":"Comércio Mineiro","City":"São Paulo","Country":"Brazil"}
]
}
AppML के साथ, आप appml-data विशेषता में डेटा स्रोत के रूप में JSON फ़ाइल निर्दिष्ट कर सकते हैं:
उदाहरण
<table appml-data="customers.js">
<tr>
<th>Customer</th>
<th>City</th>
<th>Country</th>
</tr>
<tr appml-repeat="records">
<td>{{CustomerName}}</td>
<td>{{City}}</td>
<td>{{Country}}</td>
</tr>
</table>
एक डेटाबेस का उपयोग कर AppML
वेब सर्वर की थोड़ी सी मदद से, आप अपने एप्लिकेशन को SQL डेटा के साथ फीड कर सकते हैं।
यह उदाहरण MySQL डेटाबेस से डेटा पढ़ने के लिए PHP का उपयोग करता है:
उदाहरण
<table appml-data="https://www.w3schools.com/appml/customers.php">
<tr>
<th>Customer</th>
<th>City</th>
<th>Country</th>
</tr>
<tr appml-repeat="records">
<td>{{CustomerName}}</td>
<td>{{City}}</td>
<td>{{Country}}</td>
</tr>
</table>
AppML की शक्ति
आप AppML की शक्ति का पता लगाने वाले हैं।
AppML आपको निम्न के लिए डेटा, नियंत्रक और मॉडल प्रदान कर सकता है:
- सुपर-आसान HTML अनुप्रयोग विकास
- सुपर-आसान मॉडलिंग, प्रोटोटाइपिंग और परीक्षण
आप HTML पेज के अंदर जितने चाहें उतने AppML एप्लिकेशन डाल सकते हैं।
AppML पृष्ठ के अन्य भागों में हस्तक्षेप नहीं करता है।
आपके पास पूर्ण HTML, CSS और JavaScript स्वतंत्रता है।
AppML का उपयोग पूर्ण पैमाने पर CRUD वेब अनुप्रयोगों को विकसित करने के लिए किया जा सकता है।
सीआरयूडी: सी रीट , आर ईड , यू पीडेट, डी इलीट ।
AppML की शक्ति का पता लगाने के लिए: AppML डेमो देखें ।