Add practical examples showing facade alternatives to Antlers tags
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 42/100
- Issue-Typ
- Dokumentation
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Bereich
- documentation
Rechercherichtung
Start with the Blade documentation sections covering Antlers Blade Components and fluent tags, then locate the relevant facade API references for Glide, collections, taxonomies, and navigation. Add practical facade examples for common Antlers tags and explain when they suit simple data access; done means the Blade docs show clear, accurate equivalents for the examples in the issue.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
The current Blade documentation shows two approaches for using Statamic features in Blade:
- Antlers Blade Components (
<s:glide>) - verbose for simple use cases - Fluent tags (
Statamic::tag('glide')) - awkward syntax, not discoverable
However, there's a cleaner approach using facades that isn't documented at all.
For example: Image Manipulation (Glide), the docs currently show:
{{-- Using fluent tags --}}
<img src="{{
Statamic::tag('glide')->src('test.png')->width(1280)->height(800)->fetch() }}"
/>
{{-- Using Antlers Blade Components --}}
<s:glide src="test.png" width="1280" height="800">
<img src="{{ $url }}" />
</s:glide>
The second approach is clunky if you're just wanting the URL, so you're forced to use Statamic::tag() everywhere if you just want the data, but there's a much cleaner facade approach that isn't documented:
<img src="{{ Image::manipulate('test.png', ['w' => 1280, 'h' => 800]) }}" />
I prefer using Facades because it's more Laravel-like and familiar to developers, and also better IDE autocomplete support. It's also a cleaner syntax for simple use cases.
Suggestion
The Blade documentation should include a section showing facade equivalents for common Antlers tags. For example:
Collections:
// Instead of: Statamic::tag('collection:wheels')->limit(3)
Collection::findByHandle('wheels')->queryEntries()->limit(3)->get()
Taxonomies:
// Instead of: <s:taxonomy:categories>
Taxonomy::findByHandle('categories')
Navigation:
// Instead of: <s:nav:main>
Nav::find('main')->tree()
This would help developers transitioning from Antlers or building custom Blade components discover the most appropriate API for their needs.
- Vorherrschende Sprache
- PHP
- Sterne
- 133
- Forks
- 405
- Ø Merge
- 2 T. 2 Std.
- Gemergte PRs (30 T.)
- 11
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus statamic/docs
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
Chunked UploadsOffen
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
Installation / Deployment Guides
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 40/100
Maintainer antworten meist innerhalb von 1 Tag
-
Document how conditions treat empty and null valuesEvtl. vergeben @joshdaugherty hat das vor 24 Tagen übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 25/100
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
Awaiting Triage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
Maintainer antworten meist innerhalb von 1 Tag
-
tui: PHP code blocks without `<?php` are not syntax highlightedEvtl. vergeben @SwastikTripathi hat das vor 1 Tag übernommen. Offenreproduced
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
anomalyco/opencode#58664 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 87/100
WordPress/phpunit-test-runner#364 ·
Maintainer antworten meist innerhalb von 4 Tagen
-
domain/framework Platform(Default) priority/high
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag