AppML Verileri
AppML'nin temel amacı, HTML sayfalarına veri sağlamaktır.
AppML'yi Verilere Bağlama
- AppML, değişkenlerden gelen verileri görüntüleyebilir
- AppML dosyalardan veri görüntüleyebilir
- AppML veritabanlarından gelen verileri görüntüleyebilir
JavaScript Nesnesi Kullanan AppML
HTML ve Verileri ayırmanın yaygın bir yolu, verileri bir JavaScript nesnesinde depolamaktır.
Örnek
<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 Dosyası Kullanan AppML
HTML ve Verileri ayırmanın başka bir yaygın yolu, verileri bir JSON dosyasında depolamaktır:
müşteriler.js
{
"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 ile, appml-data özniteliğinde veri kaynağı olarak bir JSON dosyası belirtebilirsiniz:
Örnek
<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>
Bir Veritabanı Kullanarak AppML
Bir web sunucusundan biraz yardım alarak uygulamanızı SQL verileriyle besleyebilirsiniz.
Bu örnek, bir MySQL veritabanından veri okumak için PHP kullanır:
Örnek
<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'nin Gücü
AppML'nin gücünü keşfetmek üzeresiniz.
AppML size aşağıdakiler için veriler, denetleyiciler ve modeller sağlayabilir:
- Süper Kolay HTML Uygulama Geliştirme
- Süper Kolay Modelleme, Prototipleme ve Test Etme
Bir HTML sayfasının içine istediğiniz kadar AppML uygulaması koyabilirsiniz.
AppML, sayfanın diğer bölümlerine müdahale etmez.
Tam HTML, CSS ve JavaScript özgürlüğüne sahipsiniz.
AppML, tam ölçekli CRUD web uygulamaları geliştirmek için kullanılabilir.
CRUD: Oluştur , Oku , Güncelle , Sil .
AppML'nin gücünü keşfetmek için: Bir AppML Demosu görüntüleyin .